NET/MASTER Network Control Language (NCL) Reference Manual
LEFT
Built-in Functions
4–50 106126 Tandem Computers Incorporated
LEFT The LEFT built-in function returns the leftmost characters of a string.
LEFT(
string
,
length
[,
pad
] )
string
specifies the source string.
length
specifies the number of characters to be returned. This operand must always be a
nonnegative whole number.
pad
specifies the pad character to be used. The default is a space.
Considerations
If the length specified is greater than that of the original source string, NCL pads
the resulting string to the required length using the specified pad character.
See also RIGHT and SUBSTR. The SUBSTR built-in function extracts a substring
from a string; the RIGHT built-in function returns the rightmost characters of a
string.
Examples
The following example returns the five left characters of the string “ABC DEF GH”.
The output string is “ABC D”:
SAY LEFT(ABC DEF GH,5)
The following example returns the string “$198.00”. The input string is “$198.”. A
pad character of 0 (zero) is used to produce the seven-character result:
&A = $198.
&B = 7
&C = 0
&RESULT = LEFT(&A,&B,&C)