SQLite 3 reference · String Functions
SQLite LTRIM() Function
Remove spaces, or characters you list, from the start (left side) of a string only.
SQLite 3
Syntax
ltrim(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 leading characters.
Examples
SELECT '[' || ltrim(' left') || ']' AS result;
Output
result [left]
SELECT ltrim('000420', '0') AS number_text;
Output
number_text 420
In other languages
LTRIM()· PostgreSQL
Related
TRIM()· Remove spaces, or any characters you list, from both ends of a string. Spaces inside the string are kept.RTRIM()· Remove spaces, or characters you list, from the end (right side) of a string only.- SQL String Functions · tutorial