[Python-checkins] cpython: Issue #24204: Elaborate of the str.strip() documentation.
raymond.hettinger
python-checkins at python.org
Sat May 23 18:12:01 CEST 2015
https://hg.python.org/cpython/rev/367e3923532f
changeset: 96244:367e3923532f
user: Raymond Hettinger <python at rcn.com>
date: Sat May 23 09:11:55 2015 -0700
summary:
Issue #24204: Elaborate of the str.strip() documentation.
files:
Doc/library/stdtypes.rst | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1937,6 +1937,16 @@
>>> '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()
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list