Hi All: I'm using the titles of my pages as the subject in my webmaster email links. However some of my titles use "&" and it seems that it breaks off the rest of the title after it. Can I replace the "&" with "&"? If so how and or do I need to do some thing else? Thanks, Todd
Hi! Yes, you can replace (sub)strings. Try something like this: ------------- import string str_to_modify = 'abc xpto abc' str_to_modify.replace('abc', 'new') ------------- you get the new string: 'new xpto new' I hope this help, Paula Mangas On Thu, 10 Jan 2002, Todd Loomis wrote:
Hi All:
I'm using the titles of my pages as the subject in my webmaster email links. However some of my titles use "&" and it seems that it breaks off the rest of the title after it. Can I replace the "&" with "&"? If so how and or do I need to do some thing else?
Thanks, Todd
_______________________________________________ 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 )
import Products.PythonScripts.standard This gives you access to the html_quote(value) function. The html_quote function returns a properly quoted string. e.g. > becomes > All special characters are quoted with this one call. I haven't tested it yet, but the Book of Zope (Beehive) notes it on page 267. I hope this helps, Dave On Thu, Jan 10, 2002 at 11:42:06AM -0500, Todd Loomis wrote: ...
I'm using the titles of my pages as the subject in my webmaster email links. However some of my titles use "&" and it seems that it breaks off the rest of the title after it. Can I replace the "&" with "&"? If so how and or do I need to do some thing else? ...
-- David Huttleston Jr 7941 Tree Lane Suite 200 Madison WI 53717
On Thursday 10 January 2002 11:42 am, Todd Loomis allegedly wrote:
Hi All:
I'm using the titles of my pages as the subject in my webmaster email links. However some of my titles use "&" and it seems that it breaks off the rest of the title after it. Can I replace the "&" with "&"? If so how and or do I need to do some thing else?
Thanks, Todd
Using dtml, the html_quote option will take care of this: <dtml-var name="title" html_quote> also &dtml-title; will do the same thing. hth, /---------------------------------------------------\ Casey Duncan, Sr. Web Developer National Legal Aid and Defender Association c.duncan@nlada.org \---------------------------------------------------/
participants (4)
-
Casey Duncan -
David Huttleston Jr -
Paula Mangas -
Todd Loomis