how to find number of characters(letter a) in
the sentence
Rain Rain Go away
Answers were Sorted based on User's Feedback
Answer / lak
str ="Rain Rain Go away"
d=split(str,"a")
msgbox ubound(d)
Is This Answer Correct ? | 5 Yes | 0 No |
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 |
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 |
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 |
what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?
How will you get the last occurrence of one string within another string using vbscript?
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
how to find the textfile in the folder and copy file from one folder to another folder useing parameterigation in QTP
How will you get a string with the specified character the specified number of times in vbscript?
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.
what is the differance between BYVAL,BYREF?
how to add the shared repository file to the script file while running the script manuall
How will you check that a variable is an array in vbscript?
how to retrieve native property value in runtime?
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
How strcomp function works?