SourcePoint Intel Help

Table of Contents

left

Extract a number of characters from the beginning of a string.

Syntax

[result =] left(string-expr, n)

Where:

result

specifies an nstring variable to which the function return value is assigned. If result is not specified, the return value is displayed on the next line of the screen.

string-expr

specifies an nstring variable or string constant.

n

specifies the number of characters to extract.

Discussion

The left function returns a substring from the beginning of a string. If the number of characters to extract is greater than the length of the string, then the entire string is returned.

Example

Command input:

define nstring month = "January"
define nstring temp = left(month, 3)
temp

Result:

"Jan"

Related Topics: