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

Answers were Sorted based on User's Feedback



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

Answer / lak

str ="Rain Rain Go away"

d=split(str,"a")

msgbox ubound(d)

Is This Answer Correct ?    5 Yes 0 No

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

Answer / 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

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

Answer / aditya

Dim sentence, testchar, arr
sentence = Inputbox(" Enter a sentence" )
testchar = Inputbox(" The charecter to be checked")
arr = split(sentence, testchar)
msgbox "Total number of charecter " & testchar & " in sentence " & sentence & " is " & ubound(arr)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / usha

str="Rain Rain Go away"

set r = new regexp
r.ignorecase=true
r.global=true
r.pattern="[A]"


set p=r.execute(str)

msgbox p.count

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

Could Anybody tell me the Script for REVERSE an Interger int reverse(int num) Ex:246 to 642.. Thanks in Advance.

3 Answers   Amazon,


Why is it recommended to close the database connection every time after the work is completed?

0 Answers  


Out of the different type of operators, which are evaluated first and last in the vbscript language?

0 Answers  


sunday is sunday monday tuesday wendesday sunday thursday friday saturday sunday sunday how to count no of sunday in the text file from vb? Answer me asap

4 Answers  


What is Querystring collection?

0 Answers  






write a vb script to display factorial of a number using function

1 Answers  


i want to when we will write the scripts either after getting the build or after getting the SRS?

3 Answers  


how to automatically update the sql server2005 database records when insert in vb6?

0 Answers  


how to retrive the tooltip by using descriptive programming in qtp?

3 Answers   iGate,


Mention when to use function procedures and what are its characteristics?

0 Answers  


Can automation testing find ssame no. of bugs what we can find by manual testing?

0 Answers  


generic function for webedit box for web application

1 Answers  


Categories