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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps

1881


How can you exit from an action?

799


Tell me about your project? please help me how to tell about insurance project

1777


what QTP Options do you know?

3146


How you can replace string in qtp?

790


How do you do batch testing in wr and is it possible to do in qtp, if so explain?

695


tell me exact differenceb bw qtp and selenium?(could not tell open soure and licennce? difference in usage and technical difference?

1835


Explain how qtp identifies objects?

777


What are the differences between quicktest professional (qtp) and winrunner?

789


Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.

3269


Can the user toggle between using Local OR and shared OR for the same action?

747


Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.

3113


What is keyword view?

789


What is the difference between run time object and test object?

786


How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?

3282