Answers for "how to check string contains substring also matches position in javascript"

30

check for substring javascript

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

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

How to check whether a string contains a substring in JavaScript?

There is a String.prototype.includes in ES6:

"potato".includes("to")
Posted by: Guest on March-15-2022

Code answers related to "how to check string contains substring also matches position in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language