Purpose
LTRIM() removes, from the left end of char1, all characters contained in char2 until a character not in char2 is reached on the left end of char1 and returns the result.
Syntax
LTRIM(char1 [,char2])
Parameters
| Parameter | Description |
|---|---|
| char1 | The source string. It can be of the CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB data type. |
| char2 | The set of characters to be removed from the string. If you do not specify char2, the default value is a blank space. It can be of the CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB data type. |
Return type
If
char1is of theCHARorVARCHAR2data type, the return type isVARCHAR2.If
char1is of theNCHARorNVARCHAR2data type, the return type isNVARCHAR2.If
char1is of theLOBdata type, the return type isLOB.
Examples
The following example removes unwanted characters before Hello World! from the string #a¥!aa¥ Hello World!.
obclient> SELECT LTRIM('#a¥!aa¥ Hello World!','#a¥! ') text FROM DUAL;
+--------------+
| TEXT |
+--------------+
| Hello World! |
+--------------+
1 row in set