Problem with the strip string method

Martin Blume mblume at freesurf.ch
Sun Mar 2 11:55:52 EST 2008


"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")
'aaaxxxaaa'
>>>

HTH 
Martin






More information about the Python-list mailing list