codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strip() method makes me confused


According to documentation strip method removes heading and trailing
characters.

Why then:

txt = ",,,,,rrttggs...,..s,bananas...s.rrr"

x = txt.strip(",s.grt")

print(x)

output: banana

another example:

text = "this is text, there should be not commas, but as you see there
are still"
y = txt.strip(",")
print(text)

output: 
this is text, there should be not commas, but as you see there are still