Better string.translate?

Steve Purcell stephen_purcell at yahoo.com
Thu Mar 15 03:44:37 EST 2001


Stowasser Harald wrote:
> "Steve Purcell" <stephen_purcell at yahoo.com> schrieb :
> > Use the 'sub' function in the 're' module:
> 
> Thank you, but i don't want do delete the characters. I need to
> translate them into Spaces.

So change the '' replacement string into ' ' in the code I posted.

You could try (shock! horror!) reading the documentation for the 're.sub'
function. It'll take a long time to finish your code if you have to rely
on the mailing list to show you everything one character at a time. <wink>

   http://www.python.org/doc/lib/Contents_of_Module_re.html

-Steve

-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Any opinions expressed herein are my own and not necessarily those of Yahoo




More information about the Python-list mailing list