Check out example codes for "typescript string contains". It will help you in understanding the concepts better.
Code Example 1
const test = 'Hello World';
if (test.includes('World')) {
// Found world
}
Code Example 2
var str = "Hello world, welcome to the universe.";
var n = str.includes("world");
Learn ReactJs, React Native from akashmittal.com