PADRIGHT function

Synopsis
This function pads the end of a string with characters up to a specified length.
Variations
PADRIGHT(String, TotalLength)
Returns the original string padded on the right 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 end of the string "Matrox", returning a string of length 10.

PADRIGHT("Matrox", 10)
PADRIGHT(String, TotalLength, PaddingCharacter)
Returns the original string padded on the right 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 end of the string "Matrox", returning a string of length 10. The function returns "Matrox----"

PADRIGHT("Matrox", 10, "-")