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