$ 0 0 You can try this:var theString = "This is a string.";console.log(theString.split("is").length - 1);