Problem with the strip string method

Colin J. Williams fn681 at
Sun Mar 2 19:59:34 CET 2008

castironpi at wrote:
> On Mar 2, 11:45 am, Steve Holden <st... at> wrote:
>> I suspect what you need is the .replace() method.
> The information's there-- the word 'contiguous' might clear it up a
> bit.
>>> Return a copy of the string with the
>>> leading and 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
>>> prefix or suffix; rather, all
>>> combinations of its values are stripped:
> Return the string's substring from the first character not a member of
> 'chars' to the last such.
> Remove contiguous leading and trailing members of 'chars'.  If omitted
> or None, 'chars' defaults over to the set of whitespace set( "\n\r\t
> " ). (XXX TODO: ask Steve Reg Ex Guru this).

Thanks to all respondents, Steve Holden 
is right, I expected more than I should 

Colin W.

More information about the Python-list mailing list