Skip to main content

Description

Removes trailing spaces from a string field. Leading spaces are kept. Only the space character is removed. Trailing tabs and line breaks are kept. To remove all leading and trailing whitespace, use TRIM. To remove only leading spaces, use LTRIM.

Syntax

RTRIM(string_expression)

Examples

RTRIM(' John Smith ') returns ’ John Smith’ UPPER(LTRIM(RTRIM(' ab '))) returns ‘AB’

Return value datatype

String

Impact of null value

If input is null, returns null.
Last modified on November 17, 2026