Is there a function to find the number of occurrences of sub
strings within a string?
Answer / nath t
The below function returns number of occurrences of sub
string within a string
Function SubStrOccur(Str, SubStr)
Occr = split(Str, SubStr)
SubStrOccur = ubound(Occr)
End Function
Scenario 1:
Str = "SairamSairam Sairam"
SubStr = "Sai"
msgbox "Given SubString("&SubStr&") appeared "&SubStrOccur
(Str, SubStr)&" time(s) in given String("&Str&")"
Function return 3 (bcz "Sai" appears 3 times in the given
string.)
Scenario 2:
Str = "SairamSairam Sairam"
SubStr = "sai"
msgbox "Given SubString("&SubStr&") appeared "&SubStrOccur
(Str, SubStr)&" time(s) in given String("&Str&")"
Function return 0 (bcz here "sai" is in small letters
doesn't appear in the given string.)
| Is This Answer Correct ? | 3 Yes | 0 No |
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
Hi! Using Descriptive Programming How do we get Parent object for an object. Say, i want to get a parent object for a "Link" in a web page. thanks
Can we record a video in qtp recording??
how can i prepare for QTP(8.2) to face interview ? give over view details?
How to give Table check points?
How u send bugs to dev'lpment team all at once or one by one or waht is the process?
what is the frame work in J-meter?
Is it possible to use two instances of UFT on the same machine? If not why?
how to identify the user defind varibles? plz tell me
where we save the scripts created in one project?
your coming from electrical backgroung..but y ur coming to software side?
What is Unicode Compatibility?