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 run time errors you get while you ar edoing rpg program?
What is time parameter?
What is checkpoints for qtp?
how to test background color and dynamic images during runtime
write a test script in QTP to test the text that written in an image(i.e jpg)of a web page???
Explain about the test fusion report of quicktest professional?
how can i use text check point in descriptive programming. or else is there any way to compare the text in the application and the text in data table.
What are Child Objects?
HI I want to know the detials of QTP certifications such as syllabus, study Materil etc. Can any provide me all these details?? my mail ID is krishnuvk@yahoo.com
How to open any application during Scripting?
Thanks....But can u tell me how i use the QTP for GIS with one Example...
Explain the Keyword View ?