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

How we can use the database checkpoint on a java web based application in which the database connectivity is done using JDBC->Pure Java type (in this type there is no need to create a DSN). At present in QTP we can fetch database values using checkpoint only through DSN. Is there any programming for this if we don't have DSN (ODBC)

2407


What is object repository in qtp?

966


How often were they executed?

2398


How to Upgrade or support firefox 2.0 version on QTP 9.0? I have installed QTP 9.0 and installed firefox 2.0. But in REcord and Run Settings, it shows firefox 1.5 in Web tab for browser selection.

2223


How you know that a test case is a regression test case

3896


I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?

2208


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

2048


we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

2160


what is the advantages and disadvantages of using functions instead of re usable actions

1883


Explain measuring transaction.

982


am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)

1675


can any body tell me how i create a simple script and apply output value on it .pls send me a step by step process

1714


What are the technics follow in writing VB script?

1909


How is a Step generator used in UFT?

1145


Whether qtp 9.0 supports Test director8.0

2523