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

Explain How do you create a recordset object in vbscript?

0 Answers  


hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?

0 Answers  


write a program to display configuration of a local system with the help of vb script.

0 Answers  


How regexp.execute method works?

0 Answers  


Mention what are the rules to name variable in vbscript?

0 Answers  






Which function allows you to instantiate an object given its programmatic identifier or progid?

0 Answers  


in qtp we ve datatable look like excel ,if we want to extract data from excel which saved in my documet how can i get that in datatable using vb script

2 Answers  


HI how can handle dynamic image through vb script example we have to create email id fill the edit box(these latters change wrong password) i am wating your answer

1 Answers  


What is the main difference between function and sub-procedure?

0 Answers  


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

0 Answers  


What are the rules to name variable in vbscript?

0 Answers  


wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......

0 Answers  


Categories