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

Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

1827


Explain the concept of object repository and how QTP recognizes objects?

1060


Can you write a script to check if the folder exists or not?

991


I want to grow as a Automation Engineer,Kindly help me in clearing my interview that what interviewer looks for as a Automation Engineer. I am having three years of experience in testing.

2064


what is the diffrence bw qtp architectute and qtp framework?

2011


in data driven testing for performing operations which method is easy from manual test data,keyword view,or from database.and why?

1841


What is the file extension of the code file in qtp?

1000


How do you synchronization point through DP?

1083


what is profile tool?

2242


what are the issues we will get when there is migration from QTP 8.2 to QTP 10.0? Is there any problem in executing scripts of 8.2 on 10.0?

1903


How to define array in qtp?

1021


PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME

7544


How is the Bitmap checkpoint different from Image checkpoint?

1122


Hi, how can we check or avoid the memory leakage in QTP9.2?

2094


What are the main differences of qtp and win runner?

1158