remove whitespace in python
assuming you've got some string named foo, to remove leading white space:
>>> foo.lstrip()to remove trailing whitespace:
>>> foo.rstrip()to remove both lead and trailing whitespace:
>>> foo.strip()
My blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://stinkpot.afraid.org:8080/tricks/ and update your bookmarks.
0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home