how to find number of characters(letter a) in
the sentence
Rain Rain Go away

Answer Posted / megha gupta

Dim Str, p,temp,i,l
i=0
Str= inputbox("Enter the string","User input 1")
p= inputbox("Enter the character you want to search in
specified string", "User Input 2")
l= Len(str)
Do while l>0
temp= left(str,1)
str= Right(str,l)
l=l-1
If (temp=p) Then
i=i+1
End If
Loop
Msgbox "Number of times "& p &" character in string is : "&
i &""

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

2486


How can you create a file object to work with the files in the vbscript language?

498


Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

2255


how does vb script help in web page designing? explain with example.

1582


Which command is used for writing text on a page?

571






Explain the string concatenation function in vbscript?

532


What are the disadvantages of vbscript?

646


What are the different types of loops available in the vbscript language?

525


Mention what is select case statement?

540


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2496


Compare java script and vb script?

587


In html file what is an ideal position to include vbscript?

800


How to open a file. What is the perpose of true and false mode there?

601


What is the extension of the vbscript file?

545


What's the difference between vbscript and vb.net?

545