if string contains in react code example
Example 1: angular string contains
var string = "foo";
var substring = "oo";
console.log(string.indexOf(substring) !== -1);
Example 2: typescript string contains
const test = 'Hello World';
if (test.includes('World')) {
// Found world
}