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 can
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 removing
whitespace. The chars argument
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 of string.
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'
xxxaaaxxxaaaxxx.strip(x)
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 removing
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 a string
[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 removed.
The