NET/MASTER Network Control Language (NCL) Reference Manual
WORDS
Built-in Functions
4–110 106126 Tandem Computers Incorporated
WORDS The WORDS built-in function returns the number of words in a specified string.
WORDS(
string
)
string
specifies the input string that is inspected. If a null string is specified, 0 (zero) is
returned.
Consideration
See also DELWORD and WORDPOS. The DELWORD built-in function deletes a
specified number of words from a string. The WORDPOS built-in function returns the
first position of a word or a substring of words within a specified string.
Example
In the following example, NCL counts the number of words in the string “this is a
message”. The value 4 is returned:
&A = this is a message
&RESULT = WORDS(&A)