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