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
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 |
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 |
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 |
Answer / nitin kumar
str="this is jagadish"
k=split(str," ")
msgbox("spaces are "&ubound(k))
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
How to pass parameters to Actions Pls anybody can give the answer.. Thanks in advance...
Dear Friend, I am New in QTP 10 so can any one tell me how to do QTP testing on WEB APPLICATION while writing VBScript. If Possible then Give Example how to write vbscript in QTP to test WEB Apllication. Vishal Patil
After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans
Is any limitation to xml checkpoints?
How to test the mandatory fields in QTP?
I have a tool bar where 5 different buttons are placed, but these buttons are not traceable hence i have created a virtual object on save button of this toolbar. Now pls tell me how to use this virtual object while write script.
distinguish between old version and new version QTP features.
They asked by using qtp recording writing scripting
How can we import a Open Office excel file in QTP
requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" ar = Window("Flight Reservation").WinComboBox("Fly From:").GetContent your actual value is : that shows data in combo box how can u test the both data is correct or not by using split function
How to export QTP results to an ".xls" file?
I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel how to import all rows of excel sheet to QTP during runtime