$SubCnt: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 36: | Line 36: | ||
==Products authorizing $SubCnt== | ==Products authorizing $SubCnt== | ||
<ul class="smallAndTightList"> | <h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> |
Revision as of 18:32, 25 October 2012
Count occurrences of one string in another
Most Sirius $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
<section begin="syntax" />%count = $SubCnt(string, substring) <section end="syntax" />
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')