Remove Whitespace

thunderfoot at gmail.com thunderfoot at gmail.com
Thu Apr 13 15:32:56 EDT 2006


re.sub() doesn't do the substitution in place: it returns the resulting
string. Try this:

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




More information about the Python-list mailing list