accept an email id & validate it .email id should not exceed
25 characters the mail id should contain 3 characters
excluding domain name,@ and .(dot) the last 3 characters
of the domain should be net,com or org
Answer Posted / pankaj jaju
Function IsValidEmail(strEmail)
If Len(strEmail) > 25 Then
IsValidEmail = "Email contains > 25 characters"
ElseIf LCase(Right(strEmail, 4)) <> ".net" AND LCase
(Right(strEmail, 4)) <> ".com" AND LCase(Right(strEmail,
4)) <> ".org" Then
IsValidEmail = "Email contains invalid
domain name. Use only .com or .net or .org domains only"
ElseIf UBound(Split(strEmail,"@")) > 1 Then
IsValidEmail = "@ character is used
multiple time"
ElseIf UBound(Split(strEmail,"@")) < 1 Then
IsValidEmail = "@ character is missing"
Else
IsValidEmail = True
End If
End Function
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is the standards used for writing the script in QTP
what types of bugs will we find out in banking projects for automation testing?
How will you convert a string to lower case string using vbscript?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
What is the main difference between function and sub-procedure?
Which operator can be used to do an xor operation in vbscript?
Mention what is select case statement?
What is the technology used by vb script?
What are the advantages of vbscript?
What is vbscript language used for and which earlier language is it modeled upon?
What is the purpose of regexp object in vbscript?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
What are keywords in the vbscript language?
Explain about vb script?
How will you compare two strings in vbscript?