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 |
What type of VB script u had done in expert view?
Did the scripts need lot of maintenance? If yes, why?
Explain advantages and disadvantages of ddf?
what is vmodel?advantages and disadvantages of vmodel?
Hi Friends,will any body tell to Me for which Auomation Tool their is great Requirement inht eMarket Eithr the QTP or WINRUNNER and for what reason and how long it is going to remain and wat the Scope for the automation Testing In the Future Please tll to Me In Details Ok .
I have 5 no.of Action in my Test. Out off which i should make 3rd action as my start-up action. How should i make it?
What are the details steps to connect a remote mysql database in QTP
How to handle the exceptions using recovery scenario manager in QTP?
Explain the concept of object repository and how quicktest professional (qtp) recognises objects?
Can the user toggle between using Local OR and shared OR for the same action?
How to Set the Global Sync Timeouts in QTP?
For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?