Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2577,20 +2577,19 @@ expression support in the :mod:`re` module).
Return a copy of the string with trailing characters removed. The *chars*
argument is a string specifying the set of characters to be removed. If omitted
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
argument is not a suffix; rather, all combinations of its values are stripped::
argument is not a suffix; rather, all combinations of its values are stripped:

For example:

.. doctest::

>>> ' spacious '.rstrip()
' spacious'
>>> 'mississippi'.rstrip('ipz')
'mississ'

See :meth:`str.removesuffix` for a method that will remove a single suffix
string rather than all of a set of characters. For example::
See also :meth:`strip` and :meth:`removesuffix`.

>>> 'Monty Python'.rstrip(' Python')
'M'
>>> 'Monty Python'.removesuffix(' Python')
'Monty'

.. method:: str.split(sep=None, maxsplit=-1)

Expand Down
Loading