Counts the number of times a substring occurs within a string.
COUNT(char-string,substring)
char-string is the string being searched expressed as a variable or symbol name, a dynamic array reference, or a literal enclosed in quotes.
substring is the substring being counted expressed as a variable or symbol name, a dynamic array reference, or a literal enclosed in quotes.
If the specified substring is not contained in char-string, a value of zero is returned.
If the specified substring is null, the value returned is equal to the length of the string.
Substrings can overlap in the string. For example, substring AA occurs three times in string AAAA.
M = "SMITH, JOHN" X = COUNT(M,"H") PRINT X
Prints 2, because there are two occurrences of the letter H in string M.
A = "714-854-8388" B = "8" C = COUNT(A,B)
Assigns a value of 4 to variable C, because substring B occurs in string A four times.