Skip to content

Removes all occurrences of any character present in the specified trim string from the right side of the string.

See also:

func.rtrim(<string>, <trim_string>)
func.rtrim('databend'xx, 'x')
┌────────────────────────────────┐
│ func.rtrim('databendxx', 'x') │
├────────────────────────────────┤
│ databend │
└────────────────────────────────┘
RTRIM(<string>, <trim_string>)
SELECT RTRIM('databendxx', 'x'), RTRIM('databendxx', 'xy');
┌──────────────────────────────────────────────────────┐
rtrim('databendxx', 'x') │ rtrim('databendxx', 'xy') │
├──────────────────────────┼───────────────────────────┤
│ databend │ databend │
└──────────────────────────────────────────────────────┘