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. Nothing changed. > [Dbg]>>> 'ab$%cd'.strip('$') > 'ab$%\n\rcd' No "$" at the beginning or end of string. Nothing changed. I believe that you didn't copy this from the standard input due to the presence of "\r\n" on the answer... > [Dbg]>>> 'ab$%cd'.strip('$') > 'ab$%cd' No "$" at the beginning or end of string. Nothing changed. > [Dbg]>>> ' ab$%cd '.strip('$') > ' ab$%cd ' No "$" at the beginning or end of string. Nothing changed. > [Dbg]>>> ' ab$%cd '.strip('%') > ' ab$%cd ' No "%" at the beginning or end of string. Nothing changed. -- http://mail.python.org/mailman/listinfo/python-list