Nodejs String Contains contains(strings, index)

Here you can find the source of contains(strings, index)

Method Source Code

String.prototype.contains = function(strings, index) {
   if(!Array.isArray(strings)) throw Error('1 argument is not an array');
   return strings.some(string => this.includes(string, index), this);
}

Related

  1. contains(string)
    String.prototype.contains = function(string) {
      return (this.indexOf(string) != -1);
    
  2. contains(string)
    String.prototype.contains = function(string) {
        return this.indexOf(string) > -1;
    };
    
  3. contains(string, index)
    String.prototype.contains = function (string, index) {
      return this.indexOf(string, index) !== -1;
    };
    
  4. contains(string, index)
    String.prototype.contains = function (string, index) {
      return this.indexOf(string, index) !== -1;
    };
    
  5. contains(stringSet)
    String.prototype.contains = function(stringSet) {
      for (var i=0;i<stringSet.length;i++) {
         if (this.indexOf(stringSet[i]) >= 0)
            return true;
      return false;
    };
    
  6. contains(subString)
    String.prototype.contains = function (subString) {
      return this.indexOf(subString) !== -1;
    };
    
  7. contains(substr)
    String.prototype.contains = function(substr)
      return this.indexOf(substr) > -1;
    
  8. contains(substring)
    String.prototype.contains = function(substring) {
      return !!this.match(new RegExp(substring, 'i'));
    
  9. contains(substring)
    String.prototype.contains = function(substring) {
      return this.indexOf(substring) != -1;