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 cea2d24 commit 37cef7eCopy full SHA for 37cef7e
Doc/library/stdtypes.rst
@@ -2369,7 +2369,9 @@ expression support in the :mod:`re` module).
2369
2370
If the string starts with the *prefix* string, return
2371
``string[len(prefix):]``. Otherwise, return a copy of the original
2372
- string::
+ string:
2373
+
2374
+ .. doctest::
2375
2376
>>> 'TestHook'.removeprefix('Test')
2377
'Hook'
@@ -2378,6 +2380,8 @@ expression support in the :mod:`re` module).
2378
2380
2379
2381
.. versionadded:: 3.9
2382
2383
+ See also :meth:`removesuffix` and :meth:`startswith`.
2384
2385
2386
.. method:: str.removesuffix(suffix, /)
2387
0 commit comments