LPAD()
Left-pads a string
VARCHAR
or BLOB
LPAD (str, endlen [, padstr])
Parameter | Description |
---|---|
str |
An expression of a string type |
endlen |
Output string length |
padstr |
The character or string to be used to pad the source string up to the specified length.Default is space (“ |
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 str is a
BLOB
, the result is aBLOB
.Otherwise, the result is aVARCHAR(endlen)
. -
If padstr is given and equal to
''
(empty string), no padding takes place. -
If endlen is less than the current string length, the string is truncated to endlen, even if padstr is the empty string.
Warning
|
When used on a |