Getting last char in string.

CheapSkate gua81 at XXXyahoo.com
Thu Sep 26 06:13:45 EDT 2002


then what does
s[-1:] do?

"Quinet, Joel" <joel.quinet at be.unisys.com> wrote in message
news:mailman.1033027776.19152.python-list at python.org...
> 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