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 |
What is the limitation to XML Checkpoints?
How to test background color and dynamic images during run time can you put the check point for moving objects?
Whenever we r keeping mouse pointer under the image we r getting image name. In qtp how can we do this thing.weather that name is coming or not?
what is test scheduling?
i have qtp 9.5 ver software.but i don't know the license key. if anyone have license key please send it to my personal mail id(munir.reddy@yahoo.com
in a web page How to check and display a particular word from a paragraph?
what version of test director supports the QTP? does testdirector supports the QTP9.0?
Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script
What is the difference between "Call to copy of action", "Call to existing action" & "Call to winrunner action"?
How we know the qtp has used the smart identification process for identification of the object.
how to pripare BRS/FRS Document for different projects?
Read excel using qtp descriptive programing