LEFT function

Syntax

LEFT (string, n)

Description

Use the LEFT function to extract a substring comprising the first n characters of a string, without specifying the starting character position. It is equivalent to the following substring extraction operation:

string [ 1, length ]

If string evaluates to the null value, null is returned. If n evaluates to the null value, the LEFT function fails and the program terminates with a run-time error message.

Example

PRINT LEFT("ABCDEFGH",3)

This is the program output:

ABC