$SubCnt: Difference between revisions
Jump to navigation
Jump to search
(Automatically generated page update) |
(Automatically generated page update) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Count occurrences of one string in another</span> | <span class="pageSubtitle">Count occurrences of one string in another</span> | ||
<p class="warn"><b>Note: </b> | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SubCnt function.</p> | ||
This function counts the occurrences of one string in another. | This function counts the occurrences of one string in another. | ||
Line 39: | Line 39: | ||
<li>[[List of $functions|Sirius functions]]</li> | <li>[[List of $functions|Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[[Media:JoclrNew.pdf|Janus Open Client]</li> | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[ | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li>Japanese functions</li> | <li>Japanese functions</li> | ||
<li>[ | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$SubCnt]] | [[Category:$Functions|$SubCnt]] |
Latest revision as of 23:29, 20 September 2018
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')