Re: Problem with the strip string method

2008-03-03 Thread Harold Fellermann
> Thanks to all respondents, Steve Holden > is right, I expected more than I should > have. Others have explained why all your examples work as they should. >From your exmaples, it seems like you would like strip to remove the leading and trailing characters from EVERY LINE in your string. This ca

Re: Problem with the strip string method

2008-03-02 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > On Mar 2, 11:45 am, Steve Holden <[EMAIL PROTECTED]> 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

Re: Problem with the strip string method

2008-03-02 Thread castironpi
On Mar 2, 11:45 am, Steve Holden <[EMAIL PROTECTED]> 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

Re: Problem with the strip string method

2008-03-02 Thread Steve Holden
Colin J. Williams wrote: > The Library Reference has > strip( [chars]) > > 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

Re: Problem with the strip string method

2008-03-02 Thread Martin Blume
"Colin J. Williams" schrieb > The Library Reference has > strip( [chars]) > > Return a copy of the string with the > leading and trailing characters removed. It's "leading and trailing", not "leading, trailing or embedded". >>> "xxxaaaxxx".strip("x") 'aaa' >>> "xxxaaax

Re: Problem with the strip string method

2008-03-02 Thread Jorge Godoy
Colin J. Williams wrote: > Return a copy of the string with the > leading and trailing characters removed. > Only the last two examples below behave > as expected. They all looks OK to me. > [Dbg]>>> 'ab$%\n\rcd'.strip('%') > 'ab$%\n\rcd' No "%" at the beginning or end o