Problem with the strip string method

castironpi at castironpi at
Sun Mar 2 19:16:46 CET 2008

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

> > 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).

More information about the Python-list mailing list