.count(val)
Description
Parameters
Usage On Strings
str = "aabbccdd"
log str.count("a")
// 2
// returns the number of times "a" appears in the string
log str.count("aa")
// 1
// can also count occurrences of longer substrings
log str.count("x")
// 0
// returns 0 if the substring is not foundLast updated