LEFT

The LEFT function returns the leftmost n characters from a string.

Syntax

LEFT( string, n )

string

The string from which you want to extract characters.

n

An integer value that specifies the number of characters that you want to extract from string.

Results

This function takes as arguments a string from which you want to extract a substring, starting with the first (leftmost) character in the string, and an integer that specifies the number of characters that you want to extract.

If there are fewer characters in the string than are specified in n, the entire string is returned (no padding is applied to the result).

Examples

splice> VALUES( LEFT( 'Splice Machine', 6 ) );
1
--------------
Splice

splice> VALUES( LEFT( 'Splice Machine', 3 ) );
1
--------------
Spl


splice> VALUES( LEFT( 'Splice Machine', 32 ) );
1
------------------------
Splice Machine