public bool Contains (char value);
public bool Contains (string value);
public bool Contains (char value, StringComparison comparisonType);
public bool Contains (string value, StringComparison comparisonType);
//ex
string s1 = "The quick brown fox jumps over the lazy dog";
string s2 = "fox";
bool b = s1.Contains(s2);
var email = "grepper@gmail.com";
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
const s = 'I am going to become a FULL STACK JS Dev with Coderslang';
console.log(s.includes('FULL STACK')); // true
console.log(s.includes('cheeseburger')); // false
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.");
}
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");
}