rtrim
Returns "string_expression1" with the final characters removed after the last character not in "string_expression2". If "string_expression2" is not specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
Example
rtrim ( 'ABxXxyx' , 'xy' )
Result
Returns 'ABxX'