Last 4 Letters of String

James Newton jnewton at fuelindustries.com
Thu Feb 21 12:51:22 EST 2008


>>> "string whose last four letters are abcd"[-4:]

'abcd'

 

________________________________

From: python-list-bounces+jnewton=fuelindustries.com at python.org
[mailto:python-list-bounces+jnewton=fuelindustries.com at python.org] On
Behalf Of Robert Rawlins - Think Blue
Sent: 21 February 2008 11:36
To: python-list at python.org
Subject: Last 4 Letters of String

 

Hello Guys,

 

I'm looking for a function which will give me the last 4 characters of a
given string. I'm sure it's a very simple task but I couldn't find
anything of it.

 

Any ideas?

 

Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080221/f55a716b/attachment-0001.html>


More information about the Python-list mailing list