StrCount
- count the occurrences of substring within a string

String manipulation
(AmiBroker 5.20)


SYNTAX StrCount( ''string'', ''substring'' )
RETURNS NUMBER
FUNCTION Function returns integer which is number of times substring was found in string. It is case sensitive.

The function can be used for example to count the number of commas in comma-separated list

EXAMPLE
tickers =
"AAPL,MSFT,INTC";

numtickers =
1 + StrCount( tickers, "," );
SEE ALSO StrExtract() function , StrFind() function , StrFormat() function , StrLeft() function , StrLen() function , StrMid() function , StrReplace() function , StrRight() function

References:

The StrCount function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.