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
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 |
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 |
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 |
How many types of recording modes in qtp? Which will be used when?
i am testing an online shopping application.I CLICK on a link "ADD TO CART" of that application a "new page" is open and then click on any object of that "new page". after that when i run this SCRIPT then on this "new page" QTP always shows error of "OBJECT NOT FOUND". How i solve this problem ?
WHAT IS DIFFERENCE B/W QC 9.2 AND QC 10.0
What is the difference between systemUtil and invoke method..?
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
i want 8.2 and 9.2 dacuments plhelp any body sand it to my id sandhyat1@yahoo.co.in
How software automation specialist enter steps in the Expert View?
Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5
When I used random numbers(1 to 9) with regular expression and run the test, it runs only 5 iterations with passed result instead of running all 1 to 9. Please tell me what can be the reason
how to re-install QTP 9.0 trial version.
please send detail navigation for merging of object ripositories in QTP 8.2
3 Answers Infosys, Ordain Solutions,
What r steps to migrate from Manual testing to QTP?(IN BOTH WEB BASED AND WINDOWS APP)