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 please tell me QTP 9.2 supports which version of IE and Mozilla firefox.
what is the hierarchy to use properties in descriptive programming
On what document base Descriptive programming is written if build is not yet ready ?
What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?
Explain the features and benefits of quick test pro(qtp)?
Explain Descriptive Programming Types with Examples?
how to add a runtime parameter to a data sheet?
Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?
How to Practice QTP Scripts?
What are objects? how do you select the unknow object?
Where should we turn Smart Identification ON in QTP?
in process of project exaplnation the defects are says frequently r not?