Javascript String countChar(c)

Description

Javascript String countChar(c)

String.prototype.countChar = function(c) {
    return (this.match(new RegExp(c, "g")) || []).length;
}



PreviousNext

Related