mirror of
https://github.com/python/cpython.git
synced 2026-02-08 02:40:43 +00:00
[3.13] gh-106318: Add examples for str.rpartition() method (GH-143891) (#144041)
gh-106318: Add examples for str.rpartition() method (GH-143891)
(cherry picked from commit 3c9c3d33cb)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
This commit is contained in:
parent
48a8cd1d12
commit
4ada03f47f
1 changed files with 13 additions and 0 deletions
|
|
@ -2321,6 +2321,19 @@ expression support in the :mod:`re` module).
|
|||
after the separator. If the separator is not found, return a 3-tuple containing
|
||||
two empty strings, followed by the string itself.
|
||||
|
||||
For example:
|
||||
|
||||
.. doctest::
|
||||
|
||||
>>> 'Monty Python'.rpartition(' ')
|
||||
('Monty', ' ', 'Python')
|
||||
>>> "Monty Python's Flying Circus".rpartition(' ')
|
||||
("Monty Python's Flying", ' ', 'Circus')
|
||||
>>> 'Monty Python'.rpartition('-')
|
||||
('', '', 'Monty Python')
|
||||
|
||||
See also :meth:`partition`.
|
||||
|
||||
|
||||
.. method:: str.rsplit(sep=None, maxsplit=-1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue