Purpose
This function deletes all characters in char2 from the left end of char1 until a character not in char2 is found at the left end of char1, and returns the result.
Syntax
LTRIM(char1 [,char2])
Parameters
Parameter |
Description |
|---|---|
| char1 | The string. The string can be of the CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB data type. |
| char2 | The set of characters to be deleted. If char2 is not specified, a single space is used by default. The string can be of the CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB data type. |
Return type
If
char1is of theCHARorVARCHAR2data type, the function returns a value of theVARCHAR2data type.If
char1is of theNCHARorNVARCHAR2data type, the function returns a value of theNVARCHAR2data type.If
char1is of theLOBdata type, the function returns a value of theLOBdata type.
Examples
Remove the extra characters before Hello World! in the string #a¥!aa¥ Hello World!.
obclient> SELECT LTRIM('#a¥!aa¥ Hello World!','#a¥! ') text FROM DUAL;
+--------------+
| TEXT |
+--------------+
| Hello World! |
+--------------+
1 row in set
