From: Raymond Hettinger Date: Sat, 23 May 2015 16:11:55 +0000 (-0700) Subject: Issue #24204: Elaborate of the str.strip() documentation. X-Git-Tag: v3.5.0b1~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19cfb57f5f0836b794653379169ff6e1c2c2e730;p=python Issue #24204: Elaborate of the str.strip() documentation. --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 44da97efcb..6e90451e2d 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()