The WORDS function returns the number of words in a source data string. This function examines a source data string and determines the number of words, contiguous strings of characters, separated by at least one (1) space, that exist within the string.
Category
String
Syntax
WORDS(data_string)
Parameter and Description
Parameter | Description |
---|---|
data_string | The source data string in character format. The data string can be a field from a source datastore, a variable, a constant or the result of another Function. |
Example
Examine source data field INPUT_STRING and extract the 5th word from the string. Assume that INPUT_STRING contains the value This is a test for counting words in a string. Map the result to target field TGT_WORD_COUNT.
TGT_WORD_COUNT = WORD (INPUT_STRING)
Returns the value 10 and maps the result to the target field.