RosettaCodeData/Task/Strip-whitespace-from-a-string-Top-and-tail/Python/strip-whitespace-from-a-string-top-and-tail.py
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

10 lines
239 B
Python

>>> s = ' \t \r \n String with spaces \t \r \n '
>>> s
' \t \r \n String with spaces \t \r \n '
>>> s.lstrip()
'String with spaces \t \r \n '
>>> s.rstrip()
' \t \r \n String with spaces'
>>> s.strip()
'String with spaces'
>>>