Hi...
Can anybody help me to write the vbscript for this
question..!!! Am having a string "HELLO WORLD", i want to
find how many "L"s are there.....?????
--> HANEEF <--
Answers were Sorted based on User's Feedback
str = "HELLO WORLD"
Set regex = New RegExp
regex.pattern = "L"
regex.Global = True
Set matches = regex.Execute(str)
msgbox matches.count
Is This Answer Correct ? | 10 Yes | 0 No |
Answer / nagk24
here one more using loops and inbuilt functions
cnt=0
a="HELLO WORLD"
For i=1 to len(a)
n=mid(a,i,1)
If asc(n)=asc("L")Then
cnt=cnt+1
End If
Next
print cnt
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / rajasekar
dim str,strcount,strdis
str="welcome"
strcount=split(str,"l")
strdis=ubound(strcount)
print "count" & strdis
Is This Answer Correct ? | 3 Yes | 2 No |
str = "HELLO WORLD"
str1=Replace(str,"L","")
cnt=len(str)-len(str1)
msgbox "Number of L's in str is:" cnt
Is This Answer Correct ? | 0 Yes | 0 No |
Pls answer this: What is the difference between a subroutine and a function? A. A subroutine can call itself; a function cannot B. A function returns a value; a subroutine cannot C. A function can accept arguments; a subroutine cannot. D. A subroutine can call other procedures; a function cannot.
Diff b/w test scenario's and test Procedures?
Hi, I am new to QTP and vb.script.How to start to write vb.script in QTP? Please give me suggestions?
What is the concept of hooking in QTP?
How to retrieve the property of an object in QTP?
how can i sent QTP results to the Html, notefile ,xl file give me the code using g mail login page
hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script
if there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.. plz help me on script wheather using getroproperty Q2)what is the command for taking valiue from a web table in qtp
What is the limitation to XML Checkpoints?
What are the most frequent errors you faced while executing your scripts?
The Senario is Steps to do 1.Entered userid in textbox 2.saved with details 3.i want to open user which i have created its in hurry.....
scalability testing comes under in which tool?