Getting last char in string.

Quinet, Joel joel.quinet at
Thu Sep 26 10:06:16 CEST 2002

Here under an example:

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

-----Original Message-----
From: CheapSkate [mailto:gua81 at]
Sent: jeudi 26 septembre 2002 9:49
To: python-list at
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???



More information about the Python-list mailing list