Answers for "string contains string in js"

88

javascript string contains

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

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

string contains in javascript

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

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

javascript string contains

const string = "foo",
 const substring = "oo";
  console.log(string.includes(substring));
Posted by: Guest on January-15-2022
0

js string contains

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

if (example.indexOf(ourSubstring) != 0) {
	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