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

Am going to QTP testing......but i dont know coding languages like (c,c++,java,etc)and am not having interest in coding .............can i choose testing tools like qtp to learn and get a job in software......please reply me

1 Answers  


is qtp 9.2 supported for firefox browser3.0?bcoz when i tried to create scripts with the application run on firefox browser 3.0 then qtp 9.2 didn't ct=reate the scripts?

2 Answers  


Hoe to generate all numbers in between to numbers suppose all numbers in between 1 to 100 using vbscript give me code

2 Answers  


The hybrid framework can be implemented for any application. Is it true?

0 Answers  


What are the different types of recording modes?

0 Answers  


Whether qtp 9.0 supports Test director8.0

0 Answers   TCS,


What is quicktest professional?

0 Answers  


How do we analyze the checkpoint results?

0 Answers  


How do you invoke an application using the step generator in qtp?

5 Answers  


Tell me about your project? please help me how to tell about insurance project

0 Answers   Cap Gemini,


what is the criteria for choosing test cases for automation? Ex: if you have some 300 test cases, then how many you choose for automation. what is criteria of selecting?

3 Answers   Aricent, Delhi University, TCS,


how to export the result to notepad....for example i want to enter the user name and pass word and clicking on login button ......once you click on login button the corresponding page will open ...in that page you having one list box ...here you can get either success or failure ........friends here i want export the message what ever i got either success or failure .....how to export the result to note pad

1 Answers   Mind Tree,


Categories