GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-106318: Add example for `str.find()` (#134529) · miss-islington/cpython@14a5ad1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Doc/library
    • stdtypes.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Doc/library/stdtypes.rst‎

Copy file name to clipboardExpand all lines: Doc/library/stdtypes.rst
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,14 @@ expression support in the :mod:`re` module).
19111911
Return the lowest index in the string where substring *sub* is found within
19121912
the slice ``s[start:end]``. Optional arguments *start* and *end* are
19131913
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`.
19141922

19151923
.. note::
19161924

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.