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

Why to use option explicit in vb script?

602


How will you reverse a string in vbscript?

622


Explain about scrrun.dll in vbscript?

658


How many types of operators are available in the vbscript language?

543


What is the difference between javascript and vbscript?

538






What is the use of option explicit in vbscript?

547


Explain the .wsf files?

533


Explain the string concatenation function in vbscript?

546


about vb scripting programs this type of all question& answers

1699


What is dictionary object in vbscript? Explain?

630


How are values assigned to the variables in the vbscript language?

579


How to assign a numeric value to a variable?

625


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

1796


Which date function is used in the vbscript language to find the difference between the 2 dates?

597


Which constant is used for print and display functions and works as same as pressing enter key?

534