161
I am trying to remove all spaces/tabs/newlines in python 2.7 on Linux.
I wrote this, that should do the job:
myString="I want to Remove all white \t spaces, new lines \n and tabs \t"
myString = myString.strip(' \n\t')
print myString
output:
I want to Remove all white spaces, new lines
and tabs
It seems like a simple thing to do, yet I am missing here something. Should I be importing something?