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 Object Spy?
one page contain next button.when we enter that its not going to next page.what type of error that one.
What are output values and why they are used ?
What is synchronization point in QTP?
key word driven frame work is like a folder structure Question is that where is the folder like funtion library folder,object repository,data base,application scenerio folder etc are store whether in a remote machine where we have to access or in our machine (it just like VSS)
what is descriptive programming?
How to analyzing Test Results using QTP?
what is flag=0 in qtp tool.. i am strugglin to use flag function , exactly when it is used , any real time expert pls explain clearly?
How to integrate the qualitycenter with qtp
What is checkpoints for quicktest professional (qtp)?
Hi, I am learning QTP. can someone please tell me a site from where i can learn QTP scripting Thanks in advance
How to handle dynamic objects in QTP?