String.prototype.Count = function (find) { return this.split(find).length - 1;}console.log("This is a string.".Count("is"));
This will return 2.
String.prototype.Count = function (find) { return this.split(find).length - 1;}console.log("This is a string.".Count("is"));
This will return 2.