How to delete a last character from a string

Fredrik Lundh fredrik at pythonware.com
Fri Aug 29 15:16:07 EDT 2008


dudeja.rajat at gmail.com 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.

</F>




More information about the Python-list mailing list