Hi,can anyone tell me How to found the number of 1's and 2's in the given format 1,1,2,2,3,3,4,2 using vbscript
Thanks in advance
Answer Posted / rajesh
str= "1,1,2,2,3,3,4,2"
arr = split(str,",")
for i =0 to ubound(arr) step 1
if arr(i) = "1" then
counter = counter + 1
elseif arr(i) = "2" then
counter1 = counter1 + 1
elseif arr(i) = "3" then
counter2 = counter2 + 1
elseif arr(i) = "4" then
counter3 = counter3 + 1
end if
next
msgbox "No of 1's :- " & counter
msgbox "No of 2's :- " & counter1
msgbox "No of 3's :- " &counter2
msgbox "No of 4's :- " &counter3
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
I have qtp 9.5 demo ver,I am not able to record the yahoo broeser.so anyone can tell me what setting i have to do in QTP for yahoo brower recording. why its not recognise the object of yahoo browser????
What is the syntax to call one action in another?
Why bpt?
hi guys, pls tell me for testing institution training hub, hitech city is best or not?
How to creating an output value using quicktest professional (qtp)?
What are the major/ important methods, functions in QTP we use realtime testing
Explain building blocks of the bpt framework ?
How can you give wait up to 10 seconds in qtp?
What are the types of object repository in qtp?
How QTP identify the system time that's changes every seconds?
HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?
How does QTP identify an object?
banking domain description for software tester for interview
What the differences are and best practical application of Object Repository?
Why qtp the best testing tool?