contains.js 316 B

1234567891011121314
  1. var toString = require('../lang/toString');
  2. /**
  3. * Searches for a given substring
  4. */
  5. function contains(str, substring, fromIndex){
  6. str = toString(str);
  7. substring = toString(substring);
  8. return str.indexOf(substring, fromIndex) !== -1;
  9. }
  10. module.exports = contains;