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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How reliable are the site's Internet connections required to be? And how does that affect backup system or redundant connection requirements and testing?

691


How does you pass optional arguments in qtp?

555


what are the critical test cases in crm? tell me atleast 5 critical test cases? what are the critical bug u find out while testing crm domain?

2730


How to suppress warnings from the test results page?

595


Is there any pdf or online book for QTP Scripting? Let me know more about QTP Scripting.

2417






How to save your test using quicktest professional (qtp)?

583


Which recording modes need more memory?

571


Is qtp supports uni-code?

600


For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?

606


Any body have QTP 9.5 licence key. please provide me at madhukar_dec30@yahoo.co.in

1591


To which environments does quicktest professional supports?

533


In qtp, explain what is crypt object

586


Explain about the test fusion report of quicktest professional (qtp)?

533


In qtp is it possible to check broken links of a page?

573


How to create scenario selector

1467