interpreted as in slice notation.
-.. method:: str.removeprefix(prefix, /)
-
- If the string starts with the *prefix* string, return
- ``string[len(prefix):]``. Otherwise, return a copy of the original
- string::
-
- >>> 'TestHook'.removeprefix('Test')
- 'Hook'
- >>> 'BaseTestCase'.removeprefix('Test')
- 'BaseTestCase'
-
- .. versionadded:: 3.9
-
-.. method:: str.removesuffix(suffix, /)
-
- If the string ends with the *suffix* string and that *suffix* is not empty,
- return ``string[:-len(suffix)]``. Otherwise, return a copy of the
- original string::
-
- >>> 'MiscTests'.removesuffix('Tests')
- 'Misc'
- >>> 'TmpDirMixin'.removesuffix('Tests')
- 'TmpDirMixin'
-
- .. versionadded:: 3.9
-
-
.. method:: str.encode(encoding="utf-8", errors="strict")
Return an encoded version of the string as a bytes object. Default encoding
the string itself, followed by two empty strings.
+.. method:: str.removeprefix(prefix, /)
+
+ If the string starts with the *prefix* string, return
+ ``string[len(prefix):]``. Otherwise, return a copy of the original
+ string::
+
+ >>> 'TestHook'.removeprefix('Test')
+ 'Hook'
+ >>> 'BaseTestCase'.removeprefix('Test')
+ 'BaseTestCase'
+
+ .. versionadded:: 3.9
+
+
+.. method:: str.removesuffix(suffix, /)
+
+ If the string ends with the *suffix* string and that *suffix* is not empty,
+ return ``string[:-len(suffix)]``. Otherwise, return a copy of the
+ original string::
+
+ >>> 'MiscTests'.removesuffix('Tests')
+ 'Misc'
+ >>> 'TmpDirMixin'.removesuffix('Tests')
+ 'TmpDirMixin'
+
+ .. versionadded:: 3.9
+
+
.. method:: str.replace(old, new[, count])
Return a copy of the string with all occurrences of substring *old* replaced by