PADLEFT function

Synopsis
This function pads the beginning of a string with characters up to a specified length.
Variations
PADLEFT(String, TotalLength)
Returns the original string padded on the left with spaces up to the specified size.
Parameters
String

Specifies the string to be padded.

Supported types: String.
TotalLength

Specifies the total width of the returned string, which corresponds to the length of the String plus the number of padding characters to be added.

If this parameter is less than the length of String, then no padding or trimming occurs and String is returned.

Supported types: Numeric.
Returns
Returned types: String.
Examples
1.

The following example pads spaces onto the beginning of the string "Matrox", returning a string of length 10.

PADLEFT("Matrox", 10)
PADLEFT(String, TotalLength, PaddingCharacter)
Returns the original string padded on the left with the padding character up to the specified size.
Parameters
String

Specifies the string to be padded.

Supported types: String.
TotalLength

Specifies the total width of the returned string, which corresponds to the length of the String plus the number of padding characters to be added.

If this parameter is less than the length of String, then no padding or trimming occurs and String is returned.

Supported types: Numeric.
PaddingCharacter

Specifies the character to use for padding.

Supported types: String.
Returns
Returned types: String.
Examples
1.

The following example pads dashes onto the beginning of the string "Matrox", returning a string of length 10. This function returns "----Matrox"

PADLEFT("Matrox", 10, "-")