PyDocs

Nav

Python Runtime Services

str.rstrip

builtins

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

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