How to delete a last character from a string

Derek Martin code at pizzashack.org
Fri Aug 29 14:46:53 EDT 2008


On Fri, Aug 29, 2008 at 07:28:40PM +0100, dudeja.rajat at gmail.com wrote:
> dirListFinal = []
> for item in dirList:
>            print item
>            if item.endswith('\\') == True:

             if item[-1] == '\\':

-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20080829/f6d224f9/attachment-0001.sig>


More information about the Python-list mailing list