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

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

ltrim(X, Y)

Parameters

ParameterDescription
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

Leading spacesTry it yourself
SELECT '[' || ltrim('   left') || ']' AS result;

Output

result
[left]
Leading zerosTry it yourself
SELECT ltrim('000420', '0') AS number_text;

Output

number_text
420

In other languages

Was this page helpful?