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 are the technologies supported by qtp?
Hi guys can any plz help me how to send fax in sample Flight Appication
Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script
When to Insert transactions in QTP?
waht is the difference between QTP 8.2 and 9.0 version
15 Answers AppLabs, CTS, Polaris,
Explain Different types of Checkpoints in Quick Test Professional?
What is Expert view?
in how many ways we can write the user defined functions one way i know that i.e storing it in .vbs another way i does not know my friend said that .qtf or something but start with q letter can any buddy knows about this
what is the automation framework that ur company using(actual procedure,not theoritically explination)
What exactly is the difference among all the three recording modes.
Which object model is not supported by QTP? a)COM b)DECOM c)DOM d)DCOM. Pls explain about theese object models?
Reverse a string keeping the words in the string as it is. E.G. "Quick Test Professional" O/P "Professional Test Quick"