Getting last char in string.

CheapSkate gua81 at XXXyahoo.com
Thu Sep 26 04:24:35 EDT 2002


Worked like magic
Thanks dude!


"James Kew" <james.kew at btinternet.com> wrote in message
news:amueqq$94qgr$1 at ID-71831.news.dfncis.de...
> "CheapSkate" <gua81 at XXXyahoo.com> wrote in message
> news:amue3q$h59$1 at lust.ihug.co.nz...
> > 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???
>
> if stuff[-1:] == '/':
>
> or
>
> if stuff.endswith('/'):
>
> --
> James Kew
> james.kew at btinternet.com
>
>
>





More information about the Python-list mailing list