$a = \'how are you\';
if (strpos($a,\'are\') !== false) {
echo \'true\';
}
In PHP, we can use the code above to check if a string contain speci
In javascript the includes() method can be used to determines whether a string contains particular word (or characters at specified position). Its case sensitive.
var str = "Hello there.";
var check1 = str.includes("there"); //true
var check2 = str.includes("There"); //false, the method is case sensitive
var check3 = str.includes("her"); //true
var check4 = str.includes("o",4); //true, o is at position 4 (start at 0)
var check5 = str.includes("o",6); //false o is not at position 6