Answers for "js string contain methods"

88

javascript string contains

var string = "foo",
    substring = "oo";

console.log(string.includes(substring));
Posted by: Guest on December-21-2019
0

js string contains

let example = "Example String!";
let ourSubstring = "Example";

if (str.includes(ourSubstring, 7)) {
	console.log("The word Example is in the string.");
} else {
	console.log("The word Example is not in the string");
}
Posted by: Guest on October-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language