LEFT

Action

Returns a specified number of characters from the left side of a string.

 

Syntax

LEFT ("string", length)

 

Parameters

String

String expression from which the leftmost characters are returned.

Length

Numeric expression indicating how many characters to return. If 0, a zero-length string is returned. If greater than or equal to the number of characters in string, the entire string is returned. Specifying a negative value will cause Left to return the number of characters equal to the total length of the string minus the value specified.

Returns

The substring requested.

 

Example

$x = LEFT(@USERID, 2)   ; get the first 2 chars of the userid