Sprawdź, czy JavaScript Substring
const string = "javascript";
const substring = "script";
console.log(string.includes(substring)); //true
Batman
const string = "javascript";
const substring = "script";
console.log(string.includes(substring)); //true
s = "Hello world";
console.log(s.includes("world"));
const string = "foo";
const substring = "oo";
console.log(string.includes(substring)); // true
Run code snippet
stringVariable.includes("Your Text");
if (your_string.indexOf('hello') > -1)
{
alert("hello found inside your_string");
}