LTRIM()
All functions > STRING > LTRIM()
Returns the string with whitespace from the left (beginning) removed.
Signatures
Returns: String with leading whitespace removed
LTRIM(string: VARCHAR) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String to trim |
Notes
- Removes leading whitespace only (spaces, tabs, line breaks, and similar)
- Trailing and internal whitespace are unchanged
LTRIM('')is''; if the input is NULL the result is NULL (useNULL(VARCHAR); bareNULLfails inference)
Examples
FeatureQL
SELECT
f1 := LTRIM(' hello '), -- Trim left only
f2 := LTRIM(' world '), -- Trim tab from left
f3 := LTRIM(' mixed spaces '), -- Only left trim
f4 := LTRIM('no trim needed'), -- No left whitespace
f5 := LTRIM(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