Martin v. Löwis added the comment:
It's a feature you don't understand. .strip() doesn't expect the
substring to be stripped, but a list of characters. Since the strip
characters contain /, all leading a,/,b characters get stripped (in any
order:
py> "aaab/csdfhkab///c".strip("a/b")
'csdfhk
Ezio Melotti added the comment:
http://docs.python.org/library/string.html#string.strip
string.strip(s[, chars])
Return a copy of the string with leading and trailing characters
removed. If chars is omitted or None, whitespace characters are removed.
If given and not None, chars must be a
New submission from Dongwook Jang :
Python 2.4.2 (#1, Mar 4 2008, 22:56:43)
[GCC 3.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> temp = "a/b/c"
>>> temp.strip("a")
'/b/c'
>>> temp.strip("a/")
'b/c'
>>> temp.strip("a/b")
'c'
>>> temp.strip("a/b/")
'c'
>