RTRIM()
All functions > STRING > RTRIM()
Returns the string with whitespace from the right (end) removed.
Signatures
Returns: String with trailing whitespace removed
RTRIM(string: VARCHAR) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String to trim |
Notes
- Removes trailing whitespace only (spaces, tabs, line breaks, and similar)
- Leading and internal whitespace are unchanged
RTRIM('')is''; if the input is NULL the result is NULL (useNULL(VARCHAR); bareNULLfails inference)
Examples
FeatureQL
SELECT
f1 := RTRIM(' hello '), -- Trim right only
f2 := RTRIM(' world '), -- Trim tab from right
f3 := RTRIM(' mixed spaces '), -- Only right trim
f4 := RTRIM('no trim needed'), -- No right whitespace
f5 := RTRIM(NULL(VARCHAR)) -- NULL yields NULL
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR |
|---|---|---|---|---|
| hello | world | mixed spaces | no trim needed | NULL |
On this page