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 37cef7e commit 3eb32bdCopy full SHA for 3eb32bd
Doc/library/stdtypes.rst
@@ -2387,7 +2387,9 @@ expression support in the :mod:`re` module).
2387
2388
If the string ends with the *suffix* string and that *suffix* is not empty,
2389
return ``string[:-len(suffix)]``. Otherwise, return a copy of the
2390
- original string::
+ original string:
2391
+
2392
+ .. doctest::
2393
2394
>>> 'MiscTests'.removesuffix('Tests')
2395
'Misc'
@@ -2396,6 +2398,8 @@ expression support in the :mod:`re` module).
2396
2398
2397
2399
.. versionadded:: 3.9
2400
2401
+ See also :meth:`removeprefix` and :meth:`endswith`.
2402
2403
2404
.. method:: str.replace(old, new, /, count=-1)
2405
0 commit comments