Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadb278d

Browse files
committed
pythongh-108316: Add example forstr.endswith()
WIP tofixpython#106318 using the contributions frompython#105670
1 parent09e72cf commitadb278d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎Doc/library/stdtypes.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,14 @@ expression support in the :mod:`re` module).
18631863
Return the lowest index in the string where substring *sub* is found within
18641864
the slice ``s[start:end]``. Optional arguments *start* and *end* are
18651865
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
18661872

1873+
See also:meth:`rfind` and:meth:`index`.
18671874
..note::
18681875

18691876
The:meth:`~str.find` method should be used only if you need to know the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp