Removing whitespace

Shae Erisson shapr at uab.edu
Mon Jul 31 06:18:50 EDT 2000


pauljolly at my-deja.com wrote:
> 
> Dear All,
> 
> Firstly, apologies for all the questions! However, extensive searching
> and reading of manuals has not helped me here. How does one remove
> whitespace characters from a string (using the re module)? I have tried
> using the re.compile('\s*') method, followed by the split() function
> but no success. Any help much appreciated with example code is possible.

I wouldn't use the re module.
I'd use strip function in the string module.
-- 
Shae Matijs Erisson - http://www.webwitches.com/~shae/
VirtualPairProgramming Wanted - Linux/Emacs/Python/Speak Freely
.fi: rakastan ohjelmointia - python kengittää aasia



More information about the Python-list mailing list