filmov
tv
javascript - How to count string occurrence in string?

Показать описание
#short
#javascript
#regex
#string
How can I count the number of times a particular string occurs in another string. For example, this is what I am trying to do in Javascript:
var temp = "This is a string.";
#javascript
#regex
#string
How can I count the number of times a particular string occurs in another string. For example, this is what I am trying to do in Javascript:
var temp = "This is a string.";