how to truncate to get the 1st 5 chars from a string

Donn donn.ingle at gmail.com
Thu Sep 24 05:12:01 CEST 2009


On Thursday 24 September 2009 05:05:45 MacRules wrote:
> s="1234abcd"
 
print s[0:4] 
should do it. Not sure it's a function though.
\d
-- 
home: http://otherwise.relics.co.za/
2D vector animation : https://savannah.nongnu.org/projects/things/
Font manager : https://savannah.nongnu.org/projects/fontypython/



More information about the Python-list mailing list