Remove Whitespace

Kelvie Wong kelvie at ieee.org
Thu Apr 13 15:09:32 EDT 2006


try this:

string = 'D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0'
import re
re.sub("\s", "", string)

On 4/13/06, david brochu jr <brochu121 at gmail.com> wrote:
>
> Hi again,
>
> Trying to remove whitespace from a string in a text file.
>
> the string is:
> D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0
>
> how would i go about doing this?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>



More information about the Python-list mailing list