Answers for "string contains check in javascript"

3

javascript string contains

var email = "[email protected]";
if(email.includes("@")){
  console.log("Email is valid");
}
else{
  console.log("Email is not valid");
}
// includes return boolean, if your string found => true else => false
Posted by: Guest on June-19-2021
3

string contains javascript

const s1 = 'javascript';
const s2 = 'python';

console.log(s1.includes('script')); // true
console.log(s2.includes('script')); // false
Posted by: Guest on February-05-2021

Code answers related to "string contains check in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language