SQLite 3 reference · String Functions
SQLite RTRIM() Function
Remove spaces, or characters you list, from the end (right side) of a string only.
SQLite 3
Syntax
rtrim(X, Y)
Parameters
| Parameter | Description |
|---|---|
X |
The string (other values are converted to text). |
Y optional |
The characters to remove; spaces by default. |
Return value
The string without trailing characters.
Examples
SELECT '[' || rtrim('right ') || ']' AS result;
Output
result [right]
SELECT rtrim('https://example.com///', '/') AS url;
Output
url https://example.com
In other languages
RTRIM()· PostgreSQL
Related
TRIM()· Remove spaces, or any characters you list, from both ends of a string. Spaces inside the string are kept.LTRIM()· Remove spaces, or characters you list, from the start (left side) of a string only.- SQL String Functions · tutorial