rtrim

This function is used to remove characters from the right of str.

Similar functions:

Syntax

rtrim([<trimChars>, ]string <str>)

or

rtrim(trailing [<trimChars>] from <str>)

Parameters

Table 1 Parameters

Parameter

Mandatory

Type

Description

str

Yes

STRING

String from which characters on the right are to be removed. If the value is of the BIGINT, DECIMAL, DOUBLE, or DATETIME type, the value is implicitly converted to the STRING type for calculation.

trimChars

Yes

STRING

Characters to be removed

Return Values

The return value is of the STRING type.

  • If the value of str is not of the STRING, BIGINT, DOUBLE, DECIMAL, or DATETIME type, an error is reported.
  • If the value of str or trimChars is NULL, NULL is returned.

Example Code