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 238a1ca commit d6f7c61Copy full SHA for d6f7c61
Doc/library/stdtypes.rst
@@ -1775,6 +1775,14 @@ expression support in the :mod:`re` module).
1775
Return the lowest index in the string where substring *sub* is found within
1776
the slice ``s[start:end]``. Optional arguments *start* and *end* are
1777
interpreted as in slice notation. Return ``-1`` if *sub* is not found.
1778
+ For example::
1779
+
1780
+ >>> 'spam, spam, spam'.find('sp')
1781
+ 0
1782
+ >>> 'spam, spam, spam'.find('sp', 5)
1783
+ 6
1784
1785
+ See also :meth:`rfind` and :meth:`index`.
1786
1787
.. note::
1788
0 commit comments