RosettaCodeData/Task/Strip-whitespace-from-a-string-Top-and-tail/Python/strip-whitespace-from-a-string-top-and-tail.py
2023-07-01 13:44:08 -04: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'
>>>