str="ramanareddy12345@gmail.com"to count alphabets,numarics and special charcters pls any one knows send to answer

Answers were Sorted based on User's Feedback



str="ramanareddy12345@gmail.com"to count alphabets,numarics and special charcters pls any ..

Answer / usha

str="ramanareddy12345@gmail.com"
numbers=0
alphabets=0
specialchar=0


for i = 1 to len(str)

b = mid(str,i,1)

if isnumeric(b) then

numbers=numbers+1

ElseIf (asc(b)>=97)and (asc(b)<=122) or asc(i)>=65 and asc(i)<=90 then

alphabets=alphabets+1

else

specialchar=specialchar+1

End if

next

msgbox numbers
msgbox alphabets
msgbox specialchar

Is This Answer Correct ?    3 Yes 0 No

str="ramanareddy12345@gmail.com"to count alphabets,numarics and special charcters pls any ..

Answer / chaitanyakumar.chivukula

'Special Characters
PatternSpecialChar = "[^a-z,A-Z,0-9]"
Set objRegExp = New RegExp
objRegExp.Global = True
objRegExp.IgnoreCase = False
objRegExp.Pattern = PatternSpecialChar
Set Matches = objRegExp.Execute("ramanaReddy@123456")

for each match in Matches
a = match.value
b =b & a
Next
msgbox b
' Only Alphabetics
PatternAlphaChar = "[a-z,A-Z]"

Set objRegExp = New RegExp
objRegExp.Global = True
objRegExp.IgnoreCase = False
objRegExp.Pattern = PatternAlphaChar
Set Matches = objRegExp.Execute("ramanaReddy@123456")

for each match in Matches
a = match.value
b =b & a
Next
msgbox b

' only Numberics
PatternNumberics = "[0-9]"

Set objRegExp = New RegExp
objRegExp.Global = True
objRegExp.IgnoreCase = False
objRegExp.Pattern = PatternNumberics
Set Matches = objRegExp.Execute("ramanaReddy@123456")

for each match in Matches
a = match.value
b =b & a
Next
msgbox b

Is This Answer Correct ?    0 Yes 0 No

str="ramanareddy12345@gmail.com"to count alphabets,numarics and special charcters pls any ..

Answer / nitin sharma

Dim mystring
mystring = "ramanareddy12345@gmail.com"
stext = "12345"
mtext = "@"

X = split(mystring,"@")
Y = split(mystring,".")
'count character "@"
msgbox ubound(X)
'count character "."
msgbox ubound(Y)
ssearch = instr(1,mystring,stext)
msearch = instr(1,mystring,mtext)
Z = mid(mystring,ssearch,len(stext))
'count of numeric '12345'
If isnumeric(Z)=true Then
msgbox Len(Z)
End If

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?

0 Answers  


1. Which function is used to check whether the specified object property achieves the specified value within the specified timeout below anyone is correct 1. Check Property 2. getToproperty 3. output Pls anybody can give the answer.. Thanks in advance...

1 Answers   Navis,


What are the details steps to connect a remote mysql database in QTP

1 Answers   Verizon,


Is there any vbscript in QTP for Data Driven Test instead of using the option provided by QTP?

2 Answers  


hi is there any chance to change encoding the password

3 Answers  






what is option explicit? what is the use of it?

9 Answers   Syntel,


what is the advantages and disadvantages of using functions instead of re usable actions

0 Answers  


if the excel sheet specified in script is not there,we get run time error how to handle the error ,please anybody explain me in detail

2 Answers   Quinnox,


can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance

2 Answers  


How can you send user defined messages to test report?

0 Answers  


Hi guys, can anyone explain me whats the method for reporting the QTP test results to teamlead or non-QA member (developer/PM)? Thanks in Advance!!!!!

2 Answers  


Hello Everyone, I have a problem. QTP is capturing no action on a particular page in the application that I am trying to automate. But on the same side its working fine on other pages of the same application. Can someone please help me understand the reason behind this inconsistency.

1 Answers  


Categories