Yep, it's there, but it's not documented. Basically, anything in the python "string" module should be accessible from Zope DTML. Now, who do I have to beat up to get the 're' module added to the namespace variable??? :) - T.J. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris McDonough Sent: Tuesday, September 05, 2000 7:54 PM To: T.J. Mannos Cc: Marcus Mendes; zope@zope.org Subject: RE: [Zope] Underscore Caracter On Tue, 5 Sep 2000, T.J. Mannos wrote:
Hmm.. Shouldn't that be:
_.string.join(_.string.split('asd asd'), ' '), '_')
The second argument is implicit on string.split (it defaults to a single space). But your way works too.
Or, alternatively (and more intuitively),
_.string.replace('asd asd', ' ', '_') _.string.replace('asd_asd', '_', ' ')
It should be noted that _.string.replace() is not mentioned in the DTML reference guide. If it exists, it should be used. Sigh. I can't wait for the Zope Book to come out, I'm going to be the first buyer. ;-)
Hi Marcus,
This is untested.
Turn "asd asd" into "asd_asd" and output:
<dtml-var "_.string.join(_.string.split('asd asd'), '_')">
Turn "asd_asd" into "asd asd" and output:
<dtml-var "_.string.join(_.string.split('asd_asd', '_'))">
On Sun, 3 Sep 2000, Marcus Mendes wrote:
Hello,
I need replace 0x20 (space caracter ) to Undescore Caracter. I need also a function that UNDO this operation. How can I to do this in DTML sintaxe?
Chris McDonough Digital Creations, Publishers of Zope http://www.zope.org _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )