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 / 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 |
Post New Answer View All Answers
Explain sub procedure of vbscript.
hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me
Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?
What is difference between shared and local object repository?
Thanks....But can u tell me how i use the QTP for GIS with one Example...
Write a script to verify font style and color of a windows object using descriptive programming
Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link
What is test object?
How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one
What are parameterizing tests?
Explain the types of properties that quick test learns while recording?
How to remove the associated function library?
Which features or drawbacks of QTP lead to the upgrade for a newer version?
How to associate shared object repository to test in qtp?
How many types of recording facility are available in quicktest professional (qtp)?