On Fri, Jul 16, 2010 at 10:28 PM, Jason Friedman <[email protected]>wrote:
> $ python
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> "x.vsd-dir".rstrip("-dir")
> 'x.vs'
>
> I expected 'x.vsd' as a return value.
>
rstrip([chars])
The chars are stripped from right.
Here it's ['-', 'd','i','r'] , hence these 4 characters will be stripped
from right, so you are left with 'x.vs'
--
http://mail.python.org/mailman/listinfo/python-list