If you want to count that how many time a string is appearing in a big string the you can count it by Javascript.
I've made a prototype function for this :
String.prototype.count=function(s1) {
return (this.length - this.replace(new RegExp(s1,"g"), '').length) / s1.length;
};
No comments:
Post a Comment