Mega Code Archive

 
Categories / Python / String
 

Introducing ljust

s = 'buildConnectionString'  print s.ljust(30)                                        print s.ljust(20)                                         # ljust pads the string with spaces to the given length.  # If the given length is smaller than the length of the string, ljust will simply  # return the string unchanged. It never truncates the string.