Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is an object repository?

1011


What are the disadvantages of recording test cases in qtp?

1010


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..

2275


Explain different types of action in qtp?

1051


What is quicktest professional (qtp window?

991


Why is Client side image is preferred over server side image?

1866


how to create flat file datasubmission in qtp

2418


What is smart identification in QTP?

1031


What is recovery scenario in qtp?

970


HOw to add the recovery file at runtime to the test file .

2139


can the activities of test case design be automated?

1853


Hi ,Can any one pleas explain how to test splash objects using QTP?

2330


What are the data types in qtp?

1071


Connect to QC using AOM.

1655


Difference between test object and run time object?

965