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

Hi Sudhananda, plz send me the QTP framework with any diagram and PPTS . I want to switch to automatio, I done QTP from professional person, but he does not give me his knowledge properly. so pls help me Thaks send me on following address mirajkar.akash@gmail.com

0 Answers   TechSoft,


wt is playback facilityin qtp?

2 Answers   IBM,


How the exception handling can be done using quicktest professional?

0 Answers  


How to handle Recovery scenario in QTP. give detailed explanation about recovery scenario.

1 Answers  


Hi , I am new to VBscripting, My requirment is to write a vbscript to read a row (which has coloumns like Description, Code, date(DD/MM/YY), hours etc) and export these feilds to a Website and then click on Submit Automatically on that web page. This it should do for all the Rows in that excel file. Any help is much appriciated Thanks Shalini

2 Answers   TCS,






How do you test siebel application using qtp?

2 Answers  


How QTP recognizes Objects in AUT?

8 Answers   Blue Star,


How i can change shared repository to per test repository in qtp

1 Answers  


In a web site, Protocal has been changed http: to https: what is your approach?

2 Answers  


What is All object and Local object in Object Repositary? Explain me please.

3 Answers  


What is the difference between CVS and VSS? Are you store QTP SCRIPT In VSS OR CVS? Where you store QTP Script?

1 Answers   Brain Roots, Ordain Solutions,


Explain data driven framework?

0 Answers  


Categories