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

Please explain the role of Regular expression in QTP

0 Answers  


To retrive the test data which tool vl use and whats basis u vl write test data? its urgent

0 Answers   IBM,


How to test background color and dynamic images during run time can you put the check point for moving objects?

0 Answers  


What is throw object?

0 Answers  


How does Parameterization and Data-Driving relate to each other in QTP?

2 Answers  






Other than using import sheet statement for importing the data from excel sheet, is there any other method that can be used?

2 Answers  


Which property will you use to check the object state? (Exist)

2 Answers   Symphony,


How to retrive XML file data in QTP ? using Script(Chandana)

6 Answers   Wipro,


what could go wrong with test automation?

0 Answers  


How to add synchronisation points in qtp?

0 Answers  


How to call a test from another test?

0 Answers  


How to handle Run-time errors?

1 Answers   Crea,


Categories