Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



How can i count "spaces" in any sentence or a string if suppose " It is a Testing qu..

Answer / ravi

arrResult= split("It is a Testing question", " ")
msgbox "No. of Spaces " & ubound(arrResult)

Is This Answer Correct ?    18 Yes 1 No

How can i count "spaces" in any sentence or a string if suppose " It is a Testing qu..

Answer / sri

s="Gita is a good girl "
d=split(s," ")
count =0
For i=ubound(d) to 1 step -1
count =count +1

Next
msgbox count

Is This Answer Correct ?    11 Yes 4 No

How can i count "spaces" in any sentence or a string if suppose " It is a Testing qu..

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

How can i count "spaces" in any sentence or a string if suppose " It is a Testing qu..

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

How can i count "spaces" in any sentence or a string if suppose " It is a Testing qu..

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

Post New Answer

More QTP Interview Questions

Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay

0 Answers   Zensar,


diff between wr and qtp in detail.

4 Answers  


how can i pass parameters into function?

4 Answers   Livetek,


Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?

0 Answers   ADP, CTS,


Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script

18 Answers   IBM,


Diff b/w Health care domain and Banking Domain?

0 Answers  


what is descriptive.create()in qtp?

4 Answers   IBM,


In qtp,how to interact tool & application build?

1 Answers  


how to handle the textboxes where in it should take the sum like ex:: while posting a question in this site it will for what is the result of 6+3=__ where in we have to enter manually 9 and click on submit... but how to handle these cases in qtp.. can someone plz help me out wid dis...

1 Answers  


Basically why we need testing?

14 Answers  


What is runtime objects and test objects? What is the difference between them?

7 Answers   IBM,


How to Analyze the Checpoint results with Standard Checpoint ?

1 Answers  


Categories