Js code: returnCountOfString.js
function returnCountOfString(value,string){
var rgxp = new RegExp(string,"g")
var output = (value.match(rgxp)||[]).length;
return output
}
or
function returnCountOfString(value,string){
var rgxp = new RegExp(string,"g")
var output = value.match(rgxp).length;
return output
}
No comments:
Post a Comment