Skip to content

ltrim

Removes leading characters from a string.

ltrim( <expr> [, <chars> ] )

The string expression to be trimmed.

One or more characters to remove from the left side of <expr>.

The default value is " \t\n\r" (common whitespace characters).

This function returns a value of string data type or NULL. If either argument is NULL, returns NULL.

Remove leading 0 and # characters from a string:

SELECT ltrim('#000000123', '0#');
+---------------------------+
| ltrim('#000000123', '0#') |
|---------------------------|
| 123 |
+---------------------------+
ScopeDB Logo ScopeDB
© 2025 ScopeDB. All rights reserved.