LTRIM

2023-10-31 11:17:12  Updated

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 string from which the characters are to be removed. 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 char1 is of the CHAR or VARCHAR2 data type, the return type is VARCHAR2.

  • If char1 is of the NCHAR or NVARCHAR2 data type, the return type is NVARCHAR2.

  • If char1 is of the LOB data type, the return type is LOB.

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

Contact Us