Skip to main content

Celonis Product Documentation

LTRIM
Description

LTRIM returns the string with leading whitespace removed. Optionally pass a string argument containing Unicode characters to be trimmed from the string.

Supported input column types: STRING

Output column type: STRING

Whitespace is defined as being the whitespace characters in version 12.1.0 of the Unicode Standard.

If the trim characters are provided as the second argument, only these characters will be trimmed from the string. This argument can be provided as a string constant or a string column. All Unicode characters including whitespaces and line breaks can be specified.

Syntax
 LTRIM ( table.column [, characters ])
NULL handling

If the value is NULL, the result is NULL as well.

Examples

[1]

Remove leading whitespace from strings.

Query

Column1

         LTRIM ( "Table1"."Column1" )
        

Input

Output

Table1

Column1 : string

'Example without leading whitespace'

' Example with leading whitespace'

' PQL'

'a '

' '

''

null

' '

Result

Column1 : string

'Example without leading whitespace'

'Example with leading whitespace'

'PQL'

'a '

''

''

null

''

[2]

The characters to be trimmed are specified as xyz in the second argument. Notice that the example with a leading space is not trimmed, because the space character ' ' was not provided in the character list.

Query

Column1

         LTRIM ( "Table1"."Column1" , 'xyz' )
        

Input

Output

Table1

Column1 : string

'xxxyyyzzzCelonis'

' xxxyyyzzzLeadingSpace'

Result

Column1 : string

'Celonis'

' xxxyyyzzzLeadingSpace'

See also: