-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
gh-106318: Improve str.rstrip() method doc #143893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
1b401b4
9fa3ecc
eb31bd6
3e78e07
25ab03f
869cdd2
ae431aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2577,20 +2577,19 @@ expression support in the :mod:`re` module). | |
| Return a copy of the string with trailing characters removed. The *chars* | ||
| argument is a string specifying the set of characters to be removed. If omitted | ||
| or ``None``, the *chars* argument defaults to removing whitespace. The *chars* | ||
| argument is not a suffix; rather, all combinations of its values are stripped:: | ||
| argument is not a suffix; rather, all combinations of its values are stripped: | ||
|
|
||
| For example: | ||
|
|
||
| .. doctest:: | ||
|
|
||
| >>> ' spacious '.rstrip() | ||
| ' spacious' | ||
| >>> 'mississippi'.rstrip('ipz') | ||
| 'mississ' | ||
|
|
||
| See :meth:`str.removesuffix` for a method that will remove a single suffix | ||
| string rather than all of a set of characters. For example:: | ||
| See also :meth:`strip` and :meth:`removesuffix`. | ||
|
||
|
|
||
| >>> 'Monty Python'.rstrip(' Python') | ||
| 'M' | ||
| >>> 'Monty Python'.removesuffix(' Python') | ||
| 'Monty' | ||
|
|
||
| .. method:: str.split(sep=None, maxsplit=-1) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.