LTRIM Function [String]

Removes leading blanks from a string.

Syntax

LTRIMstring-expression )

Parameters

Parameter

Description

string-expression

The string to be trimmed.

Returns

VARCHAR

NVARCHAR

LONG VARCHAR

LONG NVARCHAR

Note: The result data type is a LONG VARCHAR. If you use LTRIM in a SELECT INTO statement, you must have an Unstructured Data Analytics Option license or use CAST and set LTRIM to the correct data type and size.

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Compatible with Adaptive Server Enterprise.

Example

The following statement returns the value “Test Message” with all leading blanks removed:

SELECT LTRIM( '     Test Message' ) FROM iq_dummy
Related reference
RTRIM Function [String]