Getting last char in string.

Quinet, Joel joel.quinet at be.unisys.com
Thu Sep 26 04:06:16 EDT 2002


Here under an example:

s = 'abcd'
print s[-1]
d
print s[-2]
c

Joel
-----Original Message-----
From: CheapSkate [mailto:gua81 at XXXyahoo.com]
Sent: jeudi 26 septembre 2002 9:49
To: python-list at python.org
Subject: Getting last char in string.


Hi, im writing a simple method that takes in a string input and check if the
last charcter is an '/'
then it will do A else do B

my Q now is how to get the last char???

Thanks


-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list