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.find()
1 parent ffaec6e commit 14a5ad1Copy full SHA for 14a5ad1
Doc/library/stdtypes.rst
@@ -1911,6 +1911,14 @@ expression support in the :mod:`re` module).
1911
Return the lowest index in the string where substring *sub* is found within
1912
the slice ``s[start:end]``. Optional arguments *start* and *end* are
1913
interpreted as in slice notation. Return ``-1`` if *sub* is not found.
1914
+ For example::
1915
+
1916
+ >>> 'spam, spam, spam'.find('sp')
1917
+ 0
1918
+ >>> 'spam, spam, spam'.find('sp', 5)
1919
+ 6
1920
1921
+ See also :meth:`rfind` and :meth:`index`.
1922
1923
.. note::
1924
0 commit comments