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 abbreviations for tsr and mtr?
17 Answers Ordain Solutions, TSR,
What is the difference between Action and Function.? when both has the same functionaltiy, when do we choose Action and when do we choose Function..??
3 Answers DST Global Solutions,
how do u prepare Test Environment ?
write string reverse prog using vb script with out using string reverse statement();
In your QTP framework, what checkpoints were applied in the script to minimize script failure due to any reason during execution?
How can i use Output Check points in QTP
What are the challenges do we face while testing webbased applcations using the automation tool QTP or any?
str="ramanareddy12345@gmail.com"to count alphabets,numarics and special charcters pls any one knows send to answer
how many maximum number of virtual users we can create?
What is test object?
Hi everybody.. I m using QTP 9.2 version., plz send me licence key is it seat or concurrent licence key... plzzzzzzzzz plz help me for this one and its Locking code:8-5C740 Maintenance number: 0123-2820602186.,
OR is full with objects but i want to add 5 more objects,but i tried merging files,shared mode and descriptive ,iwont work.is there any alternative for that