LEFT


The LEFT function extracts a sub-string of a specified length from the beginning of a string.

 

COMMAND SYNTAX

LEFT(expression, length)

 

SYNTAX ELEMENTS

expression evaluates to the string from which the sub string is extracted.
length is the number of characters that are extracted. If length is less than 1, LEFT() returns null.

 

NOTES

The LEFT() function is equivalent to sub-string extraction starting from the first character position, i.e. expression[1,length]

See also RIGHT().

 

EXAMPLE

S = "The world is my lobster"
CRT DQUOTE(LEFT(S,9))
CRT DQUOTE(LEFT(S,999))
CRT DQUOTE(LEFT(S,0))

This code displays:

"The world"
"The world is my lobster"
""


jBC