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

what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?

0 Answers   Estuate,


How will you get the last occurrence of one string within another string using vbscript?

0 Answers  


Hi all..I have two values. a=20 ,b=30 I want to perform c= a+b and c= a*b using user define function.please anyone give the answer

1 Answers  


how to find the textfile in the folder and copy file from one folder to another folder useing parameterigation in QTP

1 Answers   Accenture,


How will you get a string with the specified character the specified number of times in vbscript?

0 Answers  






Could Anybody tell me VBScript for Check if a given number is Prime number-Don't use any Built- in Functions Boolean/int is Prime(int number).. Thanks in advance.

12 Answers   Amazon, Pyroferus,


what is the differance between BYVAL,BYREF?

0 Answers  


how to add the shared repository file to the script file while running the script manuall

2 Answers  


How will you check that a variable is an array in vbscript?

0 Answers  


how to retrieve native property value in runtime?

1 Answers   Hexaware,


I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<<The data retrieved from data base >>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

0 Answers  


How strcomp function works?

0 Answers  


Categories