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 |
tell me types of environment variables? what r they? explain details? pls give anwer any one?
Approach for Installation,comaptibility,system testing
Hi,will U Please Provide me details certification for QTP &QC and also please provide me the Material also. Send to mail:jjaanu2mail@gmail.com
how to re-install QTP 9.0 trial version.
Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.
can anyone tell me from where i can download qtp demo or crack version
is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP
can u write one user defined function for webedit class.
If aclient comes to tester ask to bye a tool Keep aside about the cost,In what way we can choose the tool.
What scripting language is QTP of?
how to test globalisation testing using qtp? lets take an example: suppose i have to test the word is in hindi "ratikanta", how we test it by using descriptive programming or any method??
Explain actions in qtp ?