string.rstrip

Hank soundwave56 at yahoo.ca
Tue Sep 23 00:14:26 CEST 2003


Hi, 

I have this problem with string.rstrip

Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> mystr = "test.txt"
>>> mystr = string.rstrip(mystr, ".txt")
>>> print mystr
tes

The last 't' was stripped. Is this fixed or documented anywhere? it
works for other cases, but this one seems to give me a weird result.

Thanks




More information about the Python-list mailing list