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 |
What is optional step in qtp? How you can add optional step in qtp?
How to record objects of Windows taskbar
what are the settings to be done to make the recovery scenario created for one test to be used bye all the other tests. please tell me recovery scenario process in detail.
What type of problems one will face with QTP , if too many browsers are opened at a time?
Explain the views in the QTP GUI?
How to interact tool & application build in QTP?
What are the details steps to connect a remote mysql database in QTP
How to give Table check points?
Name the properties you would use for identifying a browser and page when using descriptive programming?
Hoe to generate all numbers in between to numbers suppose all numbers in between 1 to 100 using vbscript give me code
Explain about datafile/verification of date file when file is not available in local system?
Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji