J
John Hunter
Hank> The last 't' was stripped. Is this fixed or documented
Hank> anywhere? it works for other cases, but this one seems to
Hank> give me a weird result.
That's because rstrip removes any characters up until the first one
one that doesn't match. Since the 't' before the '.' is in the strip
string '.txt' it is stripped too. Does this example clarify:
'John D. Hun'
If you want to remove the extension, the best way is to use splitext
'test'
Hope this helps,
John Hunter
Hank> anywhere? it works for other cases, but this one seems to
Hank> give me a weird result.
That's because rstrip removes any characters up until the first one
one that doesn't match. Since the 't' before the '.' is in the strip
string '.txt' it is stripped too. Does this example clarify:
'John D. Hun'
If you want to remove the extension, the best way is to use splitext
'test'
Hope this helps,
John Hunter