How to delete a last character from a string

Fredrik Lundh fredrik at
Fri Aug 29 21:16:07 CEST 2008

dudeja.rajat at wrote:

> There is just a single \ at the end of every item. My list is as below:
> ['Results v1.0/', 'Results v1.1/']
> so,
> if x.endswith('\\'):
> is that correct?

if your list contains forward slashes, maybe you should test for forward 
slashes and not backward slashes.


More information about the Python-list mailing list