rpad
Right-pads the string str1 to a length of length using the string str2.
Syntax
rpad(string <str1>, int <length>, string <str2>)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| str1 | Yes | STRING | The string to be right-padded. |
| length | Yes | INT | The target length after right-padding. |
| str2 | Yes | STRING | The string used for padding. |
Return Values
Returns a value of type STRING.
- If length is less than the length of str1, the string is truncated from the left to length characters.
- If length is 0, an empty string is returned.
- If any input parameter is NULL, NULL is returned.
Example Code
Returns hi???.
SELECT rpad('hi', 5, '??'); Returns h.
SELECT rpad('hi', 1, '??'); What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot