javascript string number count code example Example: js string count (mainStr.split("str").length - 1) //4