The RTRIM function removes all whitespace or the specified text from the end of a string.

 

#rtrim(haystack)

#rtrim(haystack, needle)

#rtrim(haystack, needle, casesensitive)

 

Arguments:

Returns:

 

If just one argument is supplied, the value of the argument is returned with any whitespace removed from the end of the string.

 

If two or three arguments are supplied, the text of the second argument is removed from the end of the first argument which is returned. If the third argument is true, the comparison of the second argument to the end of the first argument will be case sensitive.

 

#rtrim('text ') returns 'text'

#rtrim('hello world', ' world') returns 'hello'

#rtrim('hello world', ' world', true) returns 'hello world'