You are here: Functions > LTRIM()

LTRIM()

LTRIM() returns a variable length string with any leading blanks removed.

Optionally, LTRIM() can also be used to remove other specified leading characters.

LTRIM() is similar to the TRIM() function, which removes any trailing blanks from a string and to ALLTRIM(), which removes leading and trailing blanks.

Note: The trimming operation starts at the leading edge of the string and will stop as soon as it encounters a character that is not a blank or an optional character.

Function Format

LTRIM(C,<"characters_to_remove">)

C is a character string
characters_to_remove is an optional list of non-blank leading characters to be removed

Examples

LTRIM(" abc ") = "abc "

LTRIM(" a bc ") = "a bc "

LTRIM(" 001010 00","0") = "1010 00"

LTRIM(" 1230540 00","0123") = "540 00"