Skip to content

Commit 140d99b

Browse files
committed
gh-106318: Add a successful example for str.rindex() method
1 parent 8661e67 commit 140d99b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2550,6 +2550,8 @@ expression support in the :mod:`re` module).
25502550

25512551
.. doctest::
25522552

2553+
>>> 'spam, spam, spam'.rindex('spam')
2554+
12
25532555
>>> 'spam, spam, spam'.rindex('eggs')
25542556
Traceback (most recent call last):
25552557
File "<stdin-0>", line 1, in <module>
@@ -2740,7 +2742,7 @@ expression support in the :mod:`re` module).
27402742
Return a copy of the string with the leading and trailing characters removed.
27412743
The *chars* argument is a string specifying the set of characters to be removed.
27422744
If omitted or ``None``, the *chars* argument defaults to removing whitespace.
2743-
The *chars* argument is not a prefix or suffix; rather, all combinations of its
2745+
The *chars* argument is not a prefix or suffix; rather, all comrbinations of its
27442746
values are stripped::
27452747

27462748
>>> ' spacious '.strip()

0 commit comments

Comments
 (0)