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

Answers were Sorted based on User's Feedback



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

Answer / hariharasudhan s

str1="1,1,2,2,3,3,4,2"
A = Split(str1,",")

For i = 0 to ubound(A)
IF A(i) = "1" then
Count1 = Count1 + 1
Elseif A(i) = "2" then
Count2 = Count2 + 1
End if
Next

Msgbox Count1
Msgbox Count2

Is This Answer Correct ?    5 Yes 0 No

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

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

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

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

More QTP Interview Questions

What is action required by QTP if a popup message is coming in exsisting script and now it is not coming. The script is having code to deal with popup message now when we run the script now the popup i snot coming according to new build, instead of changing the code what we can do?

7 Answers   Verizon,


If you use low level recording,what objects will be recorded in Object Repository and what properties?

3 Answers   CTS,


What is the entry criteria and exit criteria for your test automation

2 Answers   HP, Virtusa,


How can we call Winrunner functions from QTP?

1 Answers  


Explain about Standard output value, Text output value, database o/p value, Xml O/p value, Xm o/p Value

1 Answers   TCS,


hi all i have qtp 9.0, Active screen is not working means after recording script snap shots not displayed in Active screen window. i have all ready check all setting means Tool...>option...>Active screen...>Default Level button is disabled. Is there other setting is remain to set Pls help i m new for qtp

1 Answers  


How many types of Actions are there in QTP?

6 Answers   Wells Fargo,


what is the silent mode in WR?

1 Answers  


DEFECT LIFE CYCLE,WHO PUT THE STATUS AS OPEN

4 Answers   IGT,


If there r 1000 test scripts that were written. If a change to any functionality is to be made then how can we know in which script is this functionality existing.

4 Answers   iGate,


Explain the concept of object repository and how quicktest professional (qtp) recognises objects?

0 Answers  


how to test Web application using QTP software

0 Answers   Google,


Categories