how to count spaces in a given string ex: "this is jagadeesh"
in QTP with simple functional script

Answers were Sorted based on User's Feedback



how to count spaces in a given string ex: "this is jagadeesh" in QTP with simple function..

Answer / jaag@jagadeesh

dim str
str="this is jagadeesh
var=UBound(split(str," ")))
msgbox var

ans
2

Is This Answer Correct ?    19 Yes 2 No

how to count spaces in a given string ex: "this is jagadeesh" in QTP with simple function..

Answer / karthik janahan

Dim str
str = "how to count spaces in a given string"
msgbox (len(replace(str," ","..")) - len(str))

Is This Answer Correct ?    9 Yes 2 No

how to count spaces in a given string ex: "this is jagadeesh" in QTP with simple function..

Answer / ekapop (scnyl)

Hi,
Const sMY_INFO = "this is jagadeesh"

Function GetTotalSpaceFromText(ByVal sText)
Dim iTotal
Dim asInfo

asInfo = Split(sText, " ")
iTotal = UBound(asInfo)

Erase asInfo
GetTotalSpaceFromText = iTotal
End Function

Msgbox "My Text = " & sMY_INFO & vbCrLf & _
"Total Space = " & GetTotalSpaceFromText(sMY_INFO)

Is This Answer Correct ?    5 Yes 2 No

how to count spaces in a given string ex: "this is jagadeesh" in QTP with simple function..

Answer / nitin kumar

str="this is jagadish"
k=split(str," ")
msgbox("spaces are "&ubound(k))

Is This Answer Correct ?    1 Yes 0 No

how to count spaces in a given string ex: "this is jagadeesh" in QTP with simple function..

Answer / nahush

txt = "this is jagadeesh"
no_of_space = len(txt)-len(replace(txt," ",""))


MsgBox no_of_space

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How you know that a test case is a regression test case

1 Answers  


How to create Userdefined Function.Please write the steps ans also provide example where exatcly we use it.

1 Answers   HP,


I am in need of some set of QTP FAQ @ interview. Also recently in one of interview portal they asked me how you write the script for Login application which it is web -based and using Descriptive Programming? Without associating the shared object repository?Please i do need this answer very soon? Please respond me soon @ vaisu72@yahoo.com

2 Answers  


How to Creating an Output Value using QTP?

1 Answers  


WHAT IS THE DESCRIPTIVE programming when it is useful? & when to use this ?

6 Answers   CTS,






HOW MANY WAYS ARE THERE TO CPY TEST IN TEST LAB

2 Answers   IGT,


suppose i give valid user id and password to open an web base application on qtp.how qtp will know itis a valid user id and password

3 Answers  


hi everybody this questions is only for qtp real time users. anyone please clearly explain the approach u r following for qtp testing in ur company or qtp framework u r following in ur company pelase give me clear explanation then u did great favour to inexeprienced qtp users

0 Answers   Automobile, EDP,


why should we give deliver good quality software?

0 Answers  


i have data in excel sheet.i imported the data in data table.while doing parameterization,how the code knows it is a valid or invalid data?

2 Answers   Fiserv,


Through array we can execute the testcase how ? give me example

0 Answers   TCS,


What is test automation framework?which framework does QTP follow?Need some practical explanation as to how u will start ur testing process following a particular framework?

2 Answers   IBM, Sony,


Categories