From WikiChip
mirc/identifiers/$count
< mirc‎ | identifiers
Revision as of 10:53, 2 July 2014 by Zmodem (talk | contribs) (Created $count identifier - mIRC)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The $count identifier allows mIRC to return the total count of a matching substring, or set of substrings to a target string.

Synopsis

$count(string,substring,substring2,...)

Parameters

string The target string to match
substring The substring to match within the target
substring2,... The second substring to match, and beyond

Example

The example string is going to be: My string to match

Echo the matching substring count for str:

//echo -a Result: $count(My string to match,str)
Result: 1

Echo the matching substring count for str and m:

//echo -a Result: $count(My string to match,str,m)
Result: 3

The above returns 3 because str is matched to string once, and m is matched to My and match; therefore, the total matches is 3.

Compatibility

Added: mIRC v4.6

Added On: 07/09/96

See Also