WordCount

STD.Str.WordCount( source )

STD.Uni.WordCount( source [, locale ] )

sourceA string containing the words to count. Words are delimited by spaces.
localeA null-terminated string containing the language and country code to use to determine correct sort order and other operations.
Return:WordCount returns an integer value.

The WordCount function returns the number of words in the source string.

Example:

IMPORT Std;

str1 := 'a word a day keeps the doctor away';

output(LENGTH(TRIM(Str1,LEFT,RIGHT)) - LENGTH(TRIM(Str1,ALL)) + 1);
                                 //finds eight words by removing spaces

STD.Str.WordCount(str1);         //finds eight words based on space delimiter