$SubCnt

From m204wiki
Revision as of 23:29, 20 September 2018 by JALWiccan (talk | contribs) (Automatically generated page update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Count occurrences of one string in another

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SubCnt function.

This function counts the occurrences of one string in another.

Syntax

%count = $SubCnt(string, substring)

Syntax terms

%count The count of occurrences of substring in string.
string An arbitrary string.
substring Another arbitrary string.

Examples

The following statement would set %JUNK to 3:

%JUNK = $SubCnt('ABCDABAB', 'AB')

This statement would set %JUNK to 0:

%JUNK = $SubCnt('WE HAVE WAITED LONG ENOUGH', 'WEHAVE')

And this statement would set %JUNK to 4:

%JUNK = $SubCnt('WE HAVE WAITED LONG ENOUGH', 'E')

Products authorizing $SubCnt