We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e78e07 commit 25ab03fCopy full SHA for 25ab03f
1 file changed
Doc/library/stdtypes.rst
@@ -2616,7 +2616,13 @@ expression support in the :mod:`re` module).
2616
>>> 'mississippi'.rstrip('ipz')
2617
'mississ'
2618
2619
- See also :meth:`strip` and :meth:`removesuffix`.
+ See :meth:`str.removesuffix` for a method that will remove a single suffix
2620
+ string rather than all of a set of characters. For example::
2621
+
2622
+ >>> 'Monty Python'.rstrip(' Python')
2623
+ 'M'
2624
+ >>> 'Monty Python'.removesuffix(' Python')
2625
+ 'Monty'
2626
2627
2628
.. method:: str.split(sep=None, maxsplit=-1)
0 commit comments