summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-05-23 16:11:55 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-05-23 16:11:55 (GMT)
commit19cfb57f5f0836b794653379169ff6e1c2c2e730 (patch)
treed246970f10ab6adc095850fd7130ac07d03e0912
parentfd3664be00d8fad7a4f6dc029e92a4f2a6b151ac (diff)
downloadcpython-19cfb57f5f0836b794653379169ff6e1c2c2e730.zip
cpython-19cfb57f5f0836b794653379169ff6e1c2c2e730.tar.gz
cpython-19cfb57f5f0836b794653379169ff6e1c2c2e730.tar.bz2
Issue #24204: Elaborate of the str.strip() documentation.
-rw-r--r--Doc/library/stdtypes.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 44da97e..6e90451 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -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()