STD.Uni.WordCount( source [, locale ] )
| source | A string containing the words to count. Words are delimited by spaces. |
| locale | A 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