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 |
Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).
write a vb-script code to delete all the mails in my gmail in the year 2011
write a vb script to display calculator using case statement?
Explain different types of segment?
about vb scripting programs this type of all question& answers
What is purpose of scripting.filesystemobject class in vbscript?
Mention what is select case statement?
write a program to display the system specifications of client system with the help of vbScript.
while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans
Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function
write a vbscript for traffic signal
Which in-built function is used to format the number in the vbscript language?