Skip to main content

Celonis Product Documentation

RTRIM
Description

RTRIM returns the string with trailing whitespace removed. Optionally pass a string argument containing Unicode characters to be trimmed from the string.

Supported input column types: STRING

Output column type: STRING

Whitespace is defined as being the whitespace characters in version 12.1.0 of the Unicode Standard.

If the trim characters are provided as the second argument, only these characters will be trimmed from the string. This argument can be provided as a string constant or a string column. All Unicode characters including whitespaces and line breaks can be specified.

Syntax
 RTRIM ( table.column [, characters ] )
NULL handling

If the value is NULL, the result is NULL as well.

Examples

[1]

Remove trailing whitespace from strings.

Query

Column1

         RTRIM ( "Table1"."Column1" )
        

Input

Output

Table1

Column1 : string

'Example without trailing whitespace'

'Example with trailing whitespace '

'PQL '

' a'

' '

''

null

' '

Result

Column1 : string

'Example without trailing whitespace'

'Example with trailing whitespace'

'PQL'

' a'

''

''

null

''

[2]

The characters to be trimmed are specified as xyz in the second argument. Notice that the example with a trailing space is not trimmed, because the space character ' ' was not provided in the character list.

Query

Column1

         RTRIM ( "Table1"."Column1" , 'xyz' )
        

Input

Output

Table1

Column1 : string

'Celonisxxxyyyzzz'

'TrailingSpacexxxyyyzzz '

Result

Column1 : string

'Celonis'

'TrailingSpacexxxyyyzzz '

See also: