PadRight
The PadRight() function adds specified characters to the end of a string until it reaches a specified length.
Related functions: PadLeft
Syntax
PadRight (String, Length, PadChar)
String | The input text |
Length | The total length of the output string in characters |
PadChar | The character to add to the end of the string until it reaches the required length |
Note:
If the input string is longer than the required final length, the original input string is returned unaltered.
Examples
Function | Output |
PadRight(“ABC”, 5, “0”) | ABC00 |
PadRight(“123”, 10 , “X”) | 123XXXXXXX |
PadRight(“QQQQQ”,3,”@”) | QQQQQ |
PadRight(“”, 5, “8”) | 88888 |