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 function you write to do database testing with the help of qtp?
In automation testing Can we retest virtual object in the application after getting new version from the developers, is there any property will change for that object or it won't.?
Set DR= CreateObject("Mercury.DeviceReplay")
WAT IS DATA BASE AND XML CHECK POINT ?HOW TO IMPLEMENT IT ... GIVE PROPER EXAMPLE FOR IT
Do you have any knowledge about Business Processing Testing in QTP
How can I replace all the text from the QTP script with some other text. Is there any replace all function in QTP Any one can help me
What is chaild object method? When we will go for chaild object method? How to use chaild object method?
What is log file?How to write log file code?
2 Answers Apps Lab, Value Labs,
Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?
what r the main benefits of automation?
i don't have any experience in qtp? Can u please tell me What work i have to do?
if we can find the status of script in qtp that either it's pass or fail then why we need to put this status on different excel file or log file in hybrid framework .please let me know asap thanks