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 |
There are some links on the page,count and click those links and check the text on the page displayed on clicking the link.write script for this scenario.
1) 100 test boxes there in application. how to click 100 test boxes using vb script? 2) 100 objects there in web page,how we will store that 100 objects repostries?
What is the difference between Datadriven and Parameterization?
We have 10 page.In first page we 2 popup and next page we 3 popup window......(windows name is different)how can we handle the all the popups without using recovery scenario
Please any on explain usage of "on error resume next","On error goto 0" with sample code....Thankyou......... when a tester is asked to execute 100 scripts in a short time..(the server will be down in another 10 min)..how he has to run those scripts?
How to find the path of folder in which the test is saved in qtp?
what is the difference between wait and wait function
Tell me the QTP Advantages and Disadvatages ?
How to export QTP results to an ".xls" file?
Hi all, i have installed QTP8.2 in my system. but script is not generating while recording. What is the problem? is any file missing? pls let me know anybody...Thnaks
what is meant by automation tool?
How does QTP identifies the object in the application Mainly objectives are three type's OF PROPERTIES namely