NET/MASTER Network Control Language (NCL) Reference Manual
WORDINDEX
Built-in Functions
4–106 106126 Tandem Computers Incorporated
WORDINDEX The WORDINDEX built-in function returns the character position of the first character
of a specified word in a specified string.
WORDINDEX(
string
,
n
)
string
specifies the string to be processed.
n
specifies the word position in
string
(counting from the left) to be located.
n
must be a positive whole number. If
n
specifies a word position beyond the end of
the string, 0 (zero) is returned.
Consideration
See also WORD and WORDLENGTH. The WORD built-in function extracts a word
from a string; the WORDLENGTH built-in function returns the length of a specified
word in a string.
Example
In the following example, NCL finds the fourth word of the string “this is a message”,
and locates the character position in the string where this word begins. The word
“message” begins at character position 11, so “11” is returned:
&A = this is a message
&B = 4
&RESULT = WORDINDEX(&A,&B)