I am trying to use strip()
to trim off the space before and after a string. It works fine for
str1 = " abdced "
str1.strip()
However when I use it inside a function, it is not working:
def func(str1):
return str1.strip()
print func(" abdwe ")
It won't trim off any space. Anyone can tell what's happening? Thanks!