All Products
Search
Document Center

LTRIM

Last Updated: Jun 18, 2021

The LTRIM function removes the string that appears on the left.

Syntax

LTRIM(c1 [,c2])

The LTRIM function removes all the c2 characters that are included in c1 from the left end. If you do not specify c2, the default value is a single space.

Parameters

Parameter

Description

c1

The string. The string type can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB.

c2

The string to be removed. The default value is a space. The string type can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB.

Return type

If the data type of c1 is CHAR or VARCHAR2, the function returns the VARCHAR2 data type. If the data type of c1 is NCHAR or NVARCHAR2, the function returns the NVARCHAR2 data type. If the data type of c1 is CLOB, the data type of the returned string is CLOB.

Examples

Execute the following statement:

SELECT LTRIM('   gao qian jing',' ') text FROM DUAL;

The following query result is returned:

+------------------+
|   TEXT           |
+------------------+
|   gao qian jing  |
+------------------+