contains.js 316 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 var toString = require('../lang/toString'); /** * Searches for a given substring */ function contains(str, substring, fromIndex){ str = toString(str); substring = toString(substring); return str.indexOf(substring, fromIndex) !== -1; } module.exports = contains;