Possible Duplicate:
How to tell if a string contains a certain character in javascript?
Suppose I have a string in variable ex. var name="Stackoverflow"
. I want to check in this string if 'z' is exist or not? How can I check this? I don't want to find index or anything else I just want to check if value z
is exist or not.
Suppose with code. I have a variable.
var deleteboxvalue = "1111111111111111111111";
if(!deleteboxvalue.indexOf('z') >= 0){
alert("0 not exist");
return false;
}