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

can i change the runtime properties of an object ? How can i check if a parameter exists in database ?

1991


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

2077


Thanks....But can u tell me how i use the QTP for GIS with one Example...

1894


How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one

2117


Can any one say what exact diff between test->parameters, action properties-> parameters. after defining the parameters in test->settings, how can we access those parameters.(i know how to use action prop parameters)

2127


Can we create user defined functions in qtp?

1013


Hi, I am supposed to automate mainframe application through qtp. I do not know how to start abt it. Can you plz help me in first initializing the process or do you anybody have a guide book or a link which guides me through the process of automating the mainframe applications and things involved in it.

7143


What are the features supported by UFT?

1105


.have you ever written compiled module? if yes , tell me about some of the function that you wrote.

2193


How many lines of code in each script of QTP?

4493


What is quick test pro?

1069


how to test use the quality control .how to verify the image verification

3107


How QA specialist can identify when programmatic descriptions are useful?

2513


What does mean by Scope of Automation?n How we defined it?

2059


How to recognise the webelement and verifying that webelement is enabled?

2201