We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
str.startswith()
1 parent 914fbec commit 1b6d737Copy full SHA for 1b6d737
Doc/library/stdtypes.rst
@@ -2751,6 +2751,19 @@ expression support in the :mod:`re` module).
2751
test string beginning at that position. With optional *end*, stop comparing
2752
string at that position.
2753
2754
+ For example:
2755
+
2756
+ .. doctest::
2757
2758
+ >>> 'Python'.startswith('Py')
2759
+ True
2760
+ >>> 'a tuple of prefixes'.startswith(('at', 'a'))
2761
2762
+ >>> 'Python is amazing'.startswith('is', 7)
2763
2764
2765
+ See also :meth:`endswith` and :meth:`removeprefix`.
2766
2767
2768
.. method:: str.strip(chars=None, /)
2769
0 commit comments