RPAD() adds characters to the right side of a string until it reaches the specified length. If no characters are specified in the list, it adds spaces by default. This function is similar to LPAD(), but adds padding to the right side instead of the left side. RPAD() is useful for string formatting, alignment, and creating fixed-width strings.
RPAD(string, length [, list])
RPAD() returns a character string
// Padding with specific character
RPAD("APPLES", 10, ".") = "APPLES...."
// Padding with spaces (default)
RPAD("APPLES", 10) = "APPLES "
// Truncating when length is less than string
RPAD("APPLES", 3) = "APP"
// Edge cases
RPAD("", 5, "*") = "*****" // Empty string
RPAD("HELLO", 5) = "HELLO" // Exact length
RPAD("HELLO", 0) = "" // Zero length