https://github.com/python/cpython/commit/d6f7c615c097a78586b068d69ecb7e340591a559
commit: d6f7c615c097a78586b068d69ecb7e340591a559
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2025-08-27T06:49:19Z
summary:

[3.13] gh-106318: Add example for `str.find()` (GH-134529) (#138175)

Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>

files:
M Doc/library/stdtypes.rst

diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 7ad073a6edc9a4..7c81e77f5b21e9 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -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::
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to