[Chicago] constant length string manipulation

Doug Harvey doug.harvey at gmail.com
Thu Nov 29 23:08:44 CET 2007


I believe this satisfies the requirements:

 >>> import os, sys, string
 >>> def f ( s ):
...     return "%-5.5s" % s
...
 >>> f('doug')
'doug '
 >>> f('douglas')
'dougl'
 >>>



More information about the Chicago mailing list