Javascript String count(string)
String.prototype.count = function(string) { return this.split(string).length - 1; };