Global.String.prototype.count (str)
returns the amount of occurences of one string in another

Sourcecode in /home/hannes/helma/modules/core/String.js:
614:   String.prototype.count = function(str) {
615:       var count = 0;
616:       var offset = 0;
617:       while ((offset = this.indexOf(str, offset)) > -1) {
618:           count += 1;
619:           offset += 1;
620:       }
621:       return count;
622:   }