Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
RealityV15.1Online Documentation (MoTW) Revision 7
COUNT Function (DataBasic) (m618703+count_f.htm)
Counts the number of times a substring occurs within a string.
COUNT(string,substring)
string An expression that evaluates to the string to be searched.
substring An expression that evaluates to the substring being counted.
If substring is not found in string, a value of zero is returned.
If 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.
Note: This behaviour can be modified with the UNIQUE.COUNT compatibility switch option.
If data case insensitive mode is selected (see Case Sensitivity), case is ignored when searching string for substring .
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.