[ZPT] spacify?

Fred L. Drake, Jr. fred at zope.com
Tue Jan 6 02:38:48 EST 2004


Marc Lindahl writes:
 > like you can do in DTML... it turns '_' into ' ' in a string.

Ah... makes me so glad I never learned DTML.  ;-)  This should do what
you want:

<span tal:define='s string:foo_bar_bat_baz_splat'
      tal:content='python: s.replace("_", " ")' />


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation



More information about the ZPT mailing list