Hızlı yanıt: kod örneği
stackoverflow.com how-to-check-whether-a-string-contains-a-substring-in-javascript
ECMAScript 6 introduced : is case-sensitive and is not supported by Internet Explorer without a polyfill.In ECMAScript 5 or older environments, use , which returns -1 when a substring cannot be found:
String.prototype.includes
const string = "foo";const substring = "oo";console.log(string.includes(substring)); // true
String.prototype.includes
String.prototype.indexOf
var string = "foo";var substring = "oo";console.log(string.indexOf(substring) !== -1); // true