Introducing ljust : String ljust « String « Python






Introducing ljust

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.
           
       








Related examples in the same category