Validating
Email Address

After
checking the length of the password, the isEmailValid()
function is called to validate the email address. For simplicity, the
isEmailValid()
function will not check all the syntax rules that define a valid
email address. It just makes sure there is a single @ character that
divides the string into two parts. Its code is shown below:

Inside
isEmailValid(), we first
check whether the @ character divides the string into two elements.
If the @ character does not exist in emailAddr,
the value returned by elements()
will be 1. If there are more than one @ character, the value returned
by elements() will be
greater than 2. For example, the string "alan@andrew@somedomain.com"
can be broken into three elements: "alan", "andrew"
and "somedomain.com". In these cases, the isEmailValid()
function will return the value false.

Next
we check if the @ character is the
first or last character of the email address. If the @
character is the first character, the first element (i.e. element_1)
will be an empty string; if the @
character is the last character, the second element (i.e. element_2)
will be an empty string. In these cases, the isEmailValid()
function will return the value false.

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.