Forum Discussion
EnTerr
11 years agoRoku Guru
"TheEndless" wrote:
You could potentially use roRegex.Split to split the string into an array and count the entries, but that may drop empty strings.
roRegEx.split() does not drop empty strings. So it will work but is brutal. Here is a slightly better way:
BrightScript Debugger> s = "ha |fg d a a aa a a |"roRegEx.replaceAll() can do the same for a pattern - or if multiple stats are to be accounted, just roll over the string and collect in a dictionary.
BrightScript Debugger> ? len(s) - len(s.replace("a", ""))
7