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.
str.startswith()
1 parent 7f39393 commit 431ae0dCopy full SHA for 431ae0d
Doc/library/stdtypes.rst
@@ -2510,6 +2510,19 @@ expression support in the :mod:`re` module).
2510
test string beginning at that position. With optional *end*, stop comparing
2511
string at that position.
2512
2513
+ For example:
2514
+
2515
+ .. doctest::
2516
2517
+ >>> 'Python'.startswith('Py')
2518
+ True
2519
+ >>> 'a tuple of prefixes'.startswith(('at', 'a'))
2520
2521
+ >>> 'Python is amazing'.startswith('is', 7)
2522
2523
2524
+ See also :meth:`endswith` and :meth:`removeprefix`.
2525
2526
2527
.. method:: str.strip(chars=None, /)
2528
0 commit comments