Answers for "js how to check if a string contains a substring"

30

check for substring javascript

const string = "javascript";
const substring = "script";

console.log(string.includes(substring));  //true
Posted by: Guest on July-06-2020
2

how to check whether a string contains a substring in javascript

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

console.log(string.includes(substring)); // true
 Run code snippet
Posted by: Guest on October-19-2021

Code answers related to "js how to check if a string contains a substring"

Code answers related to "Javascript"

Browse Popular Code Answers by Language