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
What is an object repository?
What are the disadvantages of recording test cases in qtp?
write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object..
Explain different types of action in qtp?
What is quicktest professional (qtp window?
Why is Client side image is preferred over server side image?
how to create flat file datasubmission in qtp
What is smart identification in QTP?
What is recovery scenario in qtp?
HOw to add the recovery file at runtime to the test file .
can the activities of test case design be automated?
Hi ,Can any one pleas explain how to test splash objects using QTP?
What are the data types in qtp?
Connect to QC using AOM.
Difference between test object and run time object?