Last 4 Letters of String

Rafael Sachetto rsachetto at gmail.com
Thu Feb 21 12:49:38 EST 2008


Try this

>>> s = "abcdefgh"
>>> s[-4:]
'efgh

2008/2/21, Robert Rawlins - Think Blue <robert.rawlins at thinkbluemedia.co.uk>:
>
>
>
>
> 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
> --
>  http://mail.python.org/mailman/listinfo/python-list
>


-- 
Rafael Sachetto Oliveira

Sir - Simple Image Resizer
http://rsachetto.googlepages.com



More information about the Python-list mailing list