Can anyone help me with the following query
what is the pythonic way to cleanse the following strings:
Lets say I have the word
"abcd
or
'blahblah
then the words actually are
abcd, blahblah
I can think of a basic way.. but actually I am reading a huge text file..
and explicitly writing a code to read char by char seems like overkill and definitely not pythonic.. I am sure there is a pythonic way to do this..:)
Thanks
You can strip unwanted characters from the beginning and end of a string using the
str.strip()method.