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
ParameterTypeRequiredDescription
stringVARCHARYesString 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 (use NULL(VARCHAR); bare NULL fails 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 VARCHARf2 VARCHARf3 VARCHARf4 VARCHARf5 VARCHAR
hello world mixed spaces no trim neededNULL

Last update at: 2026/05/26 17:22:09