Some simple problems solved by various string methods.
How to compare strings but ignore punctuation?
How long is the leading whitespace in a string?
Make multiple spaces between words into just one space between words.
|One = "Here: is a string!"|
|Two = "Here is, a string?"|
|v = x.replace(':','').replace('!','')|
|w = v.replace(',','').replace('?','')|
|print One == Two|
|print nopunc(One) == nopunc(Two)|
|Three = " some text"|
|leadspacesize = ( len(Three) -|
|Four = "some text irregular space"|
|print ' '.join(Four.split())|