Getting last char in string.

James Kew james.kew at
Thu Sep 26 10:00:21 CEST 2002

"CheapSkate" <gua81 at> wrote in message
news:amue3q$h59$1 at
> Hi, im writing a simple method that takes in a string input and check if
> 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:] == '/':


if stuff.endswith('/'):

James Kew
james.kew at

More information about the Python-list mailing list