DSQL, PSQL
Possible name conflict
YES →
Syntax
Result type
VARCHAR
or BLOB
Description
Left-pads a string with spaces or with a user-supplied string until a given length is reached.
This function fully supports text
BLOB
s of any length and character set.If padstr is given and equals
''
(empty string), no padding takes place.
Examples
lpad ('Hello', 12) -- returns ' Hello'
lpad ('Hello', 12, '') -- returns 'Hello'
lpad ('Hello', 12, 'abcdefghij') -- returns 'abcdefgHello'
lpad ('Hello', 2) -- returns 'He'
lpad ('Hello', 2, '-') -- returns 'He'
See also