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 |
in qtp how we work with out put values and what is the process?
Error handling
What are the main differences of qtp and win runner?
How to connect to data base?
Which scripting language used by quicktest professional (qtp)?
In qtp, how you can remove the spaces from string?
can we enable smart identification for test object
What is parameter in qtp?
what is stepin & stepout?
Can any suggest me what is exposure testing?
Hi i want to export the data from applicatioon to excel and later i want to import and use it for my scripts hoe can i do this?
What are the abbreviations for tsr and mtr?
17 Answers Ordain Solutions, TSR,