You can chop off anything past 72 characters with:

s2 = s[:72]


On Apr 4, 2005, at 7:04 AM, Vines, John (Civ, ARL/CISD) wrote:

Hello. I have a question regarding strings. How do I format a string to be a specific length?
For example I need 'string1' to be 72 characters long.


Thanks for your time,
John

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

-MH

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to