ltrim
Removes leading characters from a string.
Syntax
Section titled “Syntax”ltrim( <expr> [, <chars> ] )
Arguments
Section titled “Arguments”<expr>
Section titled “<expr>”The string expression to be trimmed.
<chars>
(named) (optional)
Section titled “<chars> (named) (optional)”One or more characters to remove from the left side of <expr>
.
The default value is " \t\n\r"
(common whitespace characters).
Returns
Section titled “Returns”This function returns a value of string data type or NULL. If either argument is NULL, returns NULL.
Examples
Section titled “Examples”Remove leading 0
and #
characters from a string:
SELECT ltrim('#000000123', '0#');
+---------------------------+| ltrim('#000000123', '0#') ||---------------------------|| 123 |+---------------------------+