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 ccbe41e commit f2dd414Copy full SHA for f2dd414
Doc/library/stdtypes.rst
@@ -2735,6 +2735,21 @@ expression support in the :mod:`re` module).
2735
test string beginning at that position. With optional *end*, stop comparing
2736
string at that position.
2737
2738
+ For example:
2739
+
2740
+ .. doctest::
2741
2742
+ >>> 'Python'.startswith('Py')
2743
+ True
2744
+ >>> 'a tuple of prefixes'.startswith(('at', 'in'))
2745
+ False
2746
+ >>> 'a tuple of prefixes'.startswith(('at', 'a'))
2747
2748
+ >>> 'Python is amazing'.startswith('is', 7)
2749
2750
2751
+ See also :meth:`endswith` and :meth:`removeprefix`.
2752
2753
2754
.. method:: str.strip(chars=None, /)
2755
0 commit comments