On 25-2-2015 0:05, [email protected] wrote:
>>>> 'http://xthunder'.strip('http://')
> 'xthunder'
>>>> 'http://thunder'.strip('http://')
> 'under'
>>>>
>
> I could understand backslash but forward slash?
>
>>> help("".strip)
Help on built-in function strip:
strip(...) method of builtins.str instance
S.strip([chars]) -> str
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It strips any chars given in the argument, not as a prefix/suffix to remove.
Irmen
--
https://mail.python.org/mailman/listinfo/python-list