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
Answers were Sorted based on User's Feedback
Answer / mudaseer
vmail=inputbox("enter the value")
vstr=right(vmail,3)
if len(vmail)>25 then
msgbox "length is too high"
elseif instr(vmail,"@")=0 or instr(vmail,".")=0 then
msgbox "invalid-@ or . is absent"
elseif (instr(vmail,"@")-1)<3 then
msgbox "invalid-length to less"
elseif not(vstr="org" or vstr="com" or vstr="net") then
msgbox "invalid-domain not correct"
else msgbox "valid"
end if
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / 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 |
Is vbscript language a case-sensitive language and what does it mean?
What is string concatenation function in VBScript?
please can you help me to get a code of flames using a visual basic 6
How do i automate a website www.flyashx.com without having any test cases witin a week time.
By default in vbscript the arguments passed to functions and subroutines are by reference or by value?
What is a class in CSS?
How to return only alpha bate string from an string str = "bibhu@#$%&das&*)(SUndar"
Have any one know about Test Complete 6, please let me know. If any one have good material regarding Test Complete 6, Please send to my mail id: cns.praveen@gmail.com
Illustrate briefly about the different types of statement
how to retrieve native property value in runtime?
Mention what is the main difference between function and sub-procedure?
write a vb script to find the size of d drive?