mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.13] gh-106318: Add example for str.find() (GH-134529) (#138175)
Co-authored-by: Blaise Pabon <blaise@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
238a1ca713
commit
d6f7c615c0
1 changed files with 8 additions and 0 deletions
|
|
@ -1775,6 +1775,14 @@ expression support in the :mod:`re` module).
|
|||
Return the lowest index in the string where substring *sub* is found within
|
||||
the slice ``s[start:end]``. Optional arguments *start* and *end* are
|
||||
interpreted as in slice notation. Return ``-1`` if *sub* is not found.
|
||||
For example::
|
||||
|
||||
>>> 'spam, spam, spam'.find('sp')
|
||||
0
|
||||
>>> 'spam, spam, spam'.find('sp', 5)
|
||||
6
|
||||
|
||||
See also :meth:`rfind` and :meth:`index`.
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue