mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Issue #24204: Elaborate of the str.strip() documentation.
This commit is contained in:
parent
fd3664be00
commit
19cfb57f5f
1 changed files with 10 additions and 0 deletions
|
|
@ -1937,6 +1937,16 @@ expression support in the :mod:`re` module).
|
|||
>>> 'www.example.com'.strip('cmowz.')
|
||||
'example'
|
||||
|
||||
The outermost leading and trailing *chars* argument values are stripped
|
||||
from the string. Characters are removed from the leading end until
|
||||
reaching a string character that is not contained in the set of
|
||||
characters in *chars*. A similar action takes place on the trailing end.
|
||||
For example::
|
||||
|
||||
>>> comment_string = '#....... Section 3.2.1 Issue #32 .......'
|
||||
>>> comment_string.strip('.#! ')
|
||||
'Section 3.2.1 Issue #32'
|
||||
|
||||
|
||||
.. method:: str.swapcase()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue