Answers for "how to check whether a string contains a substring in typescript online"

8

how to check whether a string contains a substring in typescript online

const string = "foo";
const substring = "oo";

console.log(string.includes(substring));
Posted by: Guest on March-24-2020
3

typescript string contains

const test = 'Hello World';
if (test.includes('World')) { 
  // Found world
}
Posted by: Guest on May-28-2020
0

how to check whether a string contains a substring in typescript online

const string = "https://dmzlgw-bhdcdev.test.att.com";
const substring = "att.com";

console.log(string.includes(substring));
Posted by: Guest on December-17-2020

Code answers related to "how to check whether a string contains a substring in typescript online"

Code answers related to "Javascript"

Browse Popular Code Answers by Language