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 |
print the array values in ascending order?
How to generate 3 digit random number?
Mention what is byref and byval parameters in vbscript?
How will you trim the spaces on the left of a string using vbscript?
Mention what are the rules to name variable in vbscript?
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
write a vb script to display the code "vbscripting" alphabet by alphabet(i e 1st v then b and up to g)
What are subprocedures in vbscript?
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
Explain the arrays in vb script?
How to write functional test cases for send button in gmail.
Check whether given Number is Even or Odd?