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 |
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?
If you use low level recording,what objects will be recorded in Object Repository and what properties?
What is the entry criteria and exit criteria for your test automation
How can we call Winrunner functions from QTP?
Explain about Standard output value, Text output value, database o/p value, Xml O/p value, Xm o/p Value
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
How many types of Actions are there in QTP?
what is the silent mode in WR?
DEFECT LIFE CYCLE,WHO PUT THE STATUS AS OPEN
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.
Explain the concept of object repository and how quicktest professional (qtp) recognises objects?
how to test Web application using QTP software