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



Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HE..

Answer / ashok kumar

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

Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HE..

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

Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HE..

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

Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HE..

Answer / haneef

Hi..Ashok Kumar thank you yaar....its working.

->Hani<-

Is This Answer Correct ?    1 Yes 1 No

Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HE..

Answer / srikanthdas

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

Post New Answer

More QTP Interview Questions

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.

1 Answers  


Diff b/w test scenario's and test Procedures?

0 Answers  


Hi, I am new to QTP and vb.script.How to start to write vb.script in QTP? Please give me suggestions?

3 Answers  


What is the concept of hooking in QTP?

1 Answers  


How to retrieve the property of an object in QTP?

5 Answers  






how can i sent QTP results to the Html, notefile ,xl file give me the code using g mail login page

0 Answers  


hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script

4 Answers  


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

6 Answers   Logica CMG,


What is the limitation to XML Checkpoints?

1 Answers  


What are the most frequent errors you faced while executing your scripts?

1 Answers  


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.....

1 Answers  


scalability testing comes under in which tool?

4 Answers   EpuraTech,


Categories