totn MariaDB Functions

MariaDB: RTRIM Function

This MariaDB tutorial explains how to use the MariaDB RTRIM function with syntax and examples.

Description

The MariaDB RTRIM function removes all space characters from the right-hand side of a string.

Syntax

The syntax for the RTRIM function in MariaDB is:

RTRIM( string )

Parameters or Arguments

string
The string to trim the space characters from the right-hand side.

Applies To

The RTRIM function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB RTRIM function examples and explore how to use the RTRIM function in MariaDB.

For example:

SELECT RTRIM('TechOnTheNet.com    ');
Result: 'TechOnTheNet.com'

SELECT RTRIM('   Tech   on   the   net    ');
Result: '   Tech   on   the   net'

SELECT RTRIM('TechOnTheNet.com knows MariaDB!    ');
Result: 'TechOnTheNet.com knows MariaDB!'