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 |
Explain qtp(quick test professional)?
can somebody send the script to write a multiplication table in notepad through qtp
Explain the checkpoint in qtp?
What is Version control?
Give the syntax to load function at run time.
I AM NEW IN QTP,PLZ TELL ME ANY BOOKS FOR QTP, MY COMPANY IS QTP,SO I LEARN QTP,PLZ ANYBUDY HELP ME
What kind of errors can b handled in QTP in real time scenario?
write a qtp code to display all the items in the fly from combo box or list box
Where to use Property Let, Property Get, Property Set in UFT
can any body help me out by providing links/material for descriptive programming in QTP otherwise can you post decriptive programing based interview Questetion&ans. plz help me out . i need it.
What is the Maximum syncronization timeout in seconds in QTP 9.5
I have multiple radio buttons i need to select a radio buton and i dont want to hard code i have a generic function for it there i have used select#0 so it selects first radio button but for other script i want to select the 4th radio button how i can make it still more generic
4 Answers Accenture, Acentia, LM,