How to findout the number of spaces with in STRING For Ex :
STRING is " RAJ IS A SOFTWARE ENGINEER "

Please send me the answer

Answers were Sorted based on User's Feedback



How to findout the number of spaces with in STRING For Ex : STRING is " RAJ IS A SOFTWARE ..

Answer / pavaniprasad

Dim str
str="RAJ IS A SOFTWARE ENGINEER"
s=split(str," ")
msgbox ubound(s)

Is This Answer Correct ?    13 Yes 0 No

How to findout the number of spaces with in STRING For Ex : STRING is " RAJ IS A SOFTWARE ..

Answer / shweta

str=" RAJ IS A SOFTWARE ENGINEER "

counter=0

For i=1 to len(str)
space_num=mid(str,i,1)
if space_num=" " Then
counter=counter+1
End If
Next
msgbox counter

Is This Answer Correct ?    9 Yes 0 No

How to findout the number of spaces with in STRING For Ex : STRING is " RAJ IS A SOFTWARE ..

Answer / sadriddin

str=" RAJ IS A SOFTWARE ENGINEER "

NumOfSp = Len(str) - Len(replace(str, " ", ""))

Msgbox NumOfSp

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

I have one bitmap image in my webpage. The bit map image is moving like 1 place to 2nd place and 2nd place to 3rd place Etc… in my webpage. I wanted to write script for dynamical objects like above example. Could you please send me the answer for above query.

9 Answers   IBM,


i have an array CAPGEMINI .....Here i need to check whether G is there or not ..how to do that and friends i have one big doubt that is whether it is array or string ,how we come to know that and where we consider that it's array ,where we consider that it's an string because when i want to find the length i have big doubt whether we need to use len function or ubound ... ans me for this TWO Questions any one please

7 Answers   Cap Gemini,


How to database testing by manualy?in my db having 100 records when i am retriving the data from db it shows in frent end 30 records how to find bug using QTP?plz Exp realtimers (Chandana)

7 Answers   Wipro,


Among the 3 Recoring modes,Standard, Analog and Low Level. which one is mostly used. I know that Analog id used for Graphs, Digital Signatures and Barcoding. so, which one among the 2?

1 Answers  


Hi all, Recently i faced this question in infosys What is QTP architecture?? Is Architecuture and Framework are same?? Can someone please give clear understanding of this.

3 Answers   Infosys,






What is time parameter?

1 Answers  


Explain how you can find length of array in qtp?

0 Answers  


What is the default add-ins in qtp?

0 Answers  


If you use low level recording,what objects will be recorded in Object Repository and what properties?

3 Answers   CTS,


What the genaric function to connect Sql Server using Sql Server Authentication and Windows Authentication

1 Answers  


By using QTP, How do you test a frame in a web page?

4 Answers   TCS,


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.

0 Answers  


Categories