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 |
Mention how to assign a date value to a variable?
How will you get the exponent of the given number in vbscript?
what do you mean .ota mobile format
How to capture a runtime error in vbscript?
Hi Friends, I am facing some issues with If,else condition,i.e. i am working on some web page for ex:gmail page.now if i want to check if username is incorrect or already exist,i want to display error message in my test report,for this i am using a simple code first,i.e. If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "Shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If But still i am getting a syntax error If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If I don't feel any thing wrong in this syntax but i don't understand why it shows such error,i am confused what went wrong,please help me out & do the favor,thanks a lot....
How can you create a file object to work with the files in the vbscript language?
What are the data types supported by vbscript?
Which data type/types are supported by vbscript language and what are their specialties?
How strcomp function works?
How to create a function in vbscript?
Explain about the support of asp for vb script functionality?
Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?