Functions

lpad

Supported By

Syntax

[the] lpad of ( string , length [, padding] )

lpad ( string , length [, padding] )

String and padding yield any strings. Length yields an integer.

Description

The lpad function prepends the specified padding to the specified string until the resulting string is longer than the specified length, then returns the rightmost length characters of the resulting string. In other words, the string is padded on the left to be aligned to the right. If no padding is specified, spaces are used.

Note

If length is zero or negative, empty is returned. If length is shorter than the specified string, only the rightmost length characters of the original string are returned.

See Also

cpad, rpad