Javascript String countString(needle)
String.prototype.countString = function(needle) { return (this.match(new RegExp(needle, 'g')) || []).length }