PyDocs

Nav

Python Runtime Services

str.strip

builtins

method of str
  • str.strip(chars=None, /)
Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.
1 Example
>>> '   spacious   '.strip()
'spacious'
>>> 'www.example.com'.strip('cmowz.')
'example'
from the Python docs
See Also
No see-alsos for builtins/str.strip
0 Notes
No notes for str.strip