Skip to main content

ljust

Left-align the value in a field of a given width.

def ljust(
value: string,
arg: integer
) - > string

Left-align the value in a field of a given width.

Parameters

NameTypeDescription
valuestringThe string value to be padded and aligned
argintegerThe total width of the resulting field in characters

Returns

TypeDescription
stringThe original string padded with spaces on the right to reach the specified total character width