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

1) 100 test boxes there in application. how to click 100 test boxes using vb script? 2) 100 objects there in web page,how we will store that 100 objects repostries?

3 Answers   ANZ,


hi i have 4 yrs exp in manual and automation testing using QTP i need sample resumes plz can u send this mail id pbre1980@gmail.com

0 Answers  


write a VBscript code to parametrize test script using test data from sqlserver database?

2 Answers   IBM, Polaris,


I am using "QTP 9.0" in my system, need to install java add-ins to test the java based applications, please prvide information from where i can get those java add-ins for QTP 9.0

0 Answers   Infosys,


how we connect 1. qtp9.2 to the quality center9.0? 2. Load runner8.0 to the quality center9.0

0 Answers  






How many types of actions are there in quicktest professional (qtp)?

0 Answers  


w is configaration management

3 Answers   TCS,


Give one example of Standard checkpoint in qtp 10?

1 Answers  


Explain Different types of Checkpoints in Quick Test Professional?

2 Answers   Crea,


How to verify the Cursor focus of a certain field?

1 Answers  


what are recovery management techiniques?

1 Answers  


How can I deploye a 'QTP Runtime environment only'

1 Answers   Indexis,


Categories