RTRIM()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a string with certain trailing characters removed.
USAGE
RTRIM(string[, trim])
Argument Name | Description |
---|---|
| The string to trim |
| Optional. The string of characters to trim. Defaults to a space |
DETAILS
RTRIM()
is a string function that returns a string with certain trailing characters removed.
If the trim
argument is not specified, one or more spaces are removed from the end of the string and the resulting value is returned.
If the trim
argument is not specified, one or more instances of trim
are removed from the end of the string and the resulting value is returned.
A NULL
is returned if either argument is NULL
.
The ISO 9075:2016 standard does not discuss
RTRIM()
function, but does discuss string value functions:For additional information on the standard, see ISO/IEC 9075-2:2016, 6.32 <string value function>
EXAMPLES
SELECT QUOTE(RTRIM(' abc ')) AS result;
+--------+
| result |
+--------+
| ' abc' |
+--------+
SELECT RTRIM('abc.....', '..') AS result;
+--------+
| result |
+--------+
| abc. |
+--------+