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
How do you do batch testing in wr & is it possible to do in qtp, if so explain?
What is Associate Repository in QTP 9.2 ?
hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)
I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?
i am looking job in perfomance testing using Loadrunner any one help me a project plz......?(Chandana) chs_29@rediffmail.com
What are the flaws in water fall model and how to overcome it?
In QTP TEST DIRECTOR COMBINATION WHAT IS THE PURPOSE OF TEST DIRECTOR? In Somebody says to store test cases and design test cases.?ok fine , but In test director 5.0 , QTp not launching. what u do?
What are the automation metrice in your project?
Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?
is it possible to add sheets to excel at runtime
How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
Explain how Does Run time data (Parameterization) is handled in QTP?
what is impact analysis on regression testing?
How is test case write?
What is the difference between QTP and WinRunner? Why do you choose only QTP for automation among remaing tools like Rational robot and silk test? Write the VBscript for any functionality in your project ? What is the cost of QTP ? If you entered into yahoo mail with your valid user name then you will get FOR EXAMPLE , " welcome to krishna " on the top of inbo page , how can you test it in QTP? What type of testing you can do, when we gave you 5 screens and how can you test that application? What type of framework you are using in your company and explain it?