Answer Posted / rajender
function isEmail (s) {
if (isEmpty(s))
if (isEmail.arguments.length == 1) return defaultEmptyOK;
else return (isEmail.arguments[1] == true);
if (isWhitespace(s)) return false;
var i = 1;
var sLength = s.length;
while ((i < sLength) && (s.charAt(i) != "@")) {
i++
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
while ((i < sLength) && (s.charAt(i) != ".")) {
i++
}
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How to read a cookie using javascript?
What is output of “20” + 20 + 20 and “20” + ( 20 + 20)? In javascript?
How to write a script for "select" lists using javascript
Why it is not advised to use innerhtml in javascript?
How to manage exception handling in javascript?
What does e mean in a function?
How do I open a website code?
What is s+ in regex?
How to get the primitive value of a string in Javascript?
What is a closure and why are they so useful to us?
Which is best for front end?
What is Currying in Javascript?
In Java coding we will write a public static void main()? Why won't we write as a static public void main()
Which is faster jquery or javascript?
What are the four basic data structures in javascript?