LPAD
Uses a given padstring to left pad a string to a certain size.
Syntax
Arguments
STRING
STRING
Type: string
The string to be padded.
SIZE
SIZE
Type: bigint
A non-negative integer specifying the length of the result string.
PADSTRING
PADSTRING
Type: string
The string to use for padding. This must be non-empty.
Returns
Type: string
STRING
left padded to SIZE
with PADSTRING
.
If SIZE
is less than the length of STRING
, the result is truncated to SIZE
characters.
Examples
STRING | SIZE | PADSTRING | Output |
---|---|---|---|
Call me Ishmael. Some years ago | 7 |
| Call me |
drizzly November | 16 | . | drizzly November |
right | 1 |
| r |
what | 9 | ?! | ?!?!?what |
| 9 |
|
|
hi | 5 | five | fivhi |
hi | 10 | five | fivefivehi |
Transformation job example
SQL
Query result
customer_firstname | padded_firstname |
---|---|
Donna | xxxxxDonna |
Lawrence | xxLawrence |
Julie | xxxxxJulie |
Last updated