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 / sisira

str1="1,1,2,2,3,3,4,2"
l=len(str1)
for i=1 to l
if mid(str1,i,"1")="1" then
count1=count1+1
elseif mid(str1,i,"1")="2" then
count2=count2+1
end if
next
msgbox count1
msgbox count2

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to do QTP Certification what is the pattern of Question paper.

2173


How will you test a keyboard?

1105


I have created 3 actions in test action1, action2, action3 but I want run action 1,action 3,action2 how can you change in the actions in keyword view?

1107


Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.

2063


Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.

3511


How to change the priorities of the recovery scenario properties?

1178


What is the difference between the keyword view and expert view?

970


What is debugging? How you debug your script?

1200


In qtp, how you can use xpath to identify objects?

1091


What are private functions in QTP? How they can be called from the function library?

1047


what is the latest version of QTP? Main difference between 9.2 and 10 version

2146


Have you faced any problems with object repository?

1061


Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji

1397


what is the mail use of frame work(with detail). architecture for keyword driven frame work

1894


What is TOM in QTP?

2226