Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2735,6 +2735,19 @@ expression support in the :mod:`re` module).
test string beginning at that position. With optional *end*, stop comparing
string at that position.

For example:

.. doctest::

>>> 'Python'.startswith('Py')
True
>>> 'a tuple of prefixes'.startswith(('at', 'a'))
True
>>> 'Python is amazing'.startswith('is', 7)
True

See also :meth:`endswith` and :meth:`removeprefix`.


.. method:: str.strip(chars=None, /)

Expand Down
Loading