How can i count "spaces" in any sentence or a string
if suppose " It is a Testing question"
Here we have 4 gaps(spaces)
Is there any function to find out spaces between words
Answers were Sorted based on User's Feedback
Answer / uma
Test:
str="it is a testing question"
Call spacecount(str,d) /*Function Call*/
msgbox "Number of spaces:" & d
User Defined Function :
Public function spacecount(a,b)
str=a
p=split(str)
coun=0
For i=1 to ubound(p)
coun=coun+1
Next
msgbox coun
b=coun /*Returns Number of spaces to the calling Function /
End Function
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / annie
a=inputbox("enter the string")
countspaces=len(a)-len(replace(a," ",""))
msgbox "count is" & countspaces
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / nitin sharma
dim mystring
mystring = "QTP world is a software engineer"
msgbox Len(mystring)-Len(Replace(mystring," ",""))
'it will give count of spaces
| Is This Answer Correct ? | 1 Yes | 0 No |
Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay
diff between wr and qtp in detail.
how can i pass parameters into function?
Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?
Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script
Diff b/w Health care domain and Banking Domain?
what is descriptive.create()in qtp?
In qtp,how to interact tool & application build?
how to handle the textboxes where in it should take the sum like ex:: while posting a question in this site it will for what is the result of 6+3=__ where in we have to enter manually 9 and click on submit... but how to handle these cases in qtp.. can someone plz help me out wid dis...
Basically why we need testing?
What is runtime objects and test objects? What is the difference between them?
How to Analyze the Checpoint results with Standard Checpoint ?