Question: Validate Email Address (filename: validateemailaddr.html ) Write a function named isValidEmailAddr(emailAddr) that takes an email address as a parameter, checks if the email address is
| Validate Email Address (filename: validateemailaddr.html)
Given a string, s, s.indexOf('@') will give you the leftmost index of the @ symbol. s.lastIndexOf('@') will give you the rightmost index. If the @ symbol is not present they will return -1. The functions will search for any parameter string you specify.
So, if you know the first and last index of '@', how can you tell if it only occurs once?
For example, if the @ is the first character, the address is invalid and return false.
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
