Javascript String countString(needle)

Description

Javascript String countString(needle)



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



PreviousNext

Related