Give code Email Checking

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


Please Help Members By Posting Answers For Below Questions

What companies use javascript?

464


Can I declare a variable as CONSTANT in JavaScript?

528


How to loop through array in javascript?

469


Public Static Void Main(String args[]) { System.out.in("Hai.."); } In the above code why string args[] is required.... If we are not giving command line argument..

1597


how can we retrieve value from one database server and store them another database server using sql server code

1550






List few advantages of using javascript?

489


What is a framework programming?

459


Is webassembly faster than javascript?

476


How to get the type of arguments passed to a function?

524


What is the use of a weakmap object in javascript?

470


What is the use of decodeuri() and encodeuri()?

494


hi i want validations for two drop down lists. when user enter to second list by skipping first list alert box should appear. drop down validation Please choose an item from the drop down menu:

Choose a username:
Choose a username:
please any body help me thanks

1709


How to convert numbers to strings using javascript?

489


How to test a string as a literal and as an object ?

552


Is javascript necessary for web development?

507