Check out example codes for "check in string starts with ts". It will help you in understanding the concepts better.

Code Example 1

var str = "Hello world, welcome to the universe.";

var n = str.startsWith("Hello"); // returns boolean

Learn ReactJs, React Native from akashmittal.com