How to write an email address validation script in TSL?

How to write an email address validation script in TSL?

public function IsValidEMAIL(in strText)

{

auto aryEmail[], aryEmail2[], n;

n = split(strText, aryEmail, \"@\");

if (n != 2)

return FALSE;

# Ensure the string \"@MyISP.Com\" does not pass.

if (!length(aryEmail[1]))

return FALSE;

n = split(aryEmail[2], aryEmail2, \".\");

if (n < 2)

return FALSE;

# Ensure the string \"Recipient@.\" does not pass.

if (!(length(aryEmai2[1]) * length(aryEmai2[1])))

return FALSE;

return TRUE;

}



By:UMANG
Date:2029-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related TESTING Subjective Links

TESTING Subjective interview questions and answers for experienced and fresher