[Tutor] How to normalize/compress whitespace in a string?
alan.gauld at btinternet.com
Fri Apr 11 19:49:10 CEST 2008
"Malcolm Greene" <python at bdurham.com> wrote in message
news:1207917464.6178.1247341705 at webmail.messagingengine.com...
> Any suggestions for how to normalize and compress whitespace in a
> By normalize I mean convert tabs and soft spaces (extended ascii
> 160) to spaces.
> By compress I mean replace all runs of 2 or more spaces (after the
> normalization step) to a single space.
> I know I can use regular expressions to accomplish the above, but
> thought that might be too heavy handed.
> Thank you!
> Tutor maillist - Tutor at python.org
More information about the Tutor