[docs] str.lstrip(char) takes too many characters
eliben at gmail.com
Sun Mar 11 04:28:14 CET 2012
> I have a string trans_11.79_1.78_133392642.sdds
> if I execute
> >> test = trans_11.79_1.78_133392642.sdds
> >> test.lstrip("trans" + "_" + 11.79 + "_" + 1.78 + "_").rstrip(".sdds")
> I get the result
> a friend verified this problem.
Byron, here's the documentation of lstrip:
Return a copy of the string with leading 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 is not a prefix; rather, all
combinations of its values are stripped:
Read the last sentence, especially, and note that "1" appears as one
of the chars that should be removed.
More information about the docs