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:
- haystack: The input string.
- needle: The text to remove from the end of the string.
- casesensiitive: true if the case of the text to remove has to match or false for a case-insensitive comparison.
Returns:
- The string with text possibly removed from the end.
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'