8000
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.endswith()
1 parent 09e72cf commit adb278d 8000 Copy full SHA for adb278d
Doc/library/stdtypes.rst
@@ -1863,7 +1863,14 @@ expression support in the :mod:`re` module).
1863
Return the lowest index in the string where substring *sub* is found within
1864
the slice ``s[start:end]``. Optional arguments *start* and *end* are
1865
interpreted as in slice notation. Return ``-1`` if *sub* is not found.
1866
+ For example::
1867
+
1868
+ >>> 'spam, spam, spam'.find('sp')
1869
+ 0
1870
+ >>> 'spam, spam, spam'.find('sp', 5)
1871
+ 6
1872
1873
+ See also :meth:`rfind` and :meth:`index`.
1874
.. note::
1875
1876
The :meth:`~str.find` method should be used only if you need to know the
0 commit comments