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 |
suppose take one row in a row 16 columns is there.in 16 columns 16 numbers is there.but i want to get each 3 column number.o/p :5 columns get in 16 columns means. so can anybody write this function? plz send if u know the answer.
How to use descriptive programming?
Hi Friends... What you are doing in Regression Testing and how many test cases you ran in regression testing... suppose there is 1000 test cases is there how many test cases again you run .. 1000 test caes r how many... thanx in advance..
WAT IS DATA BASE AND XML CHECK POINT ?HOW TO IMPLEMENT IT ... GIVE PROPER EXAMPLE FOR IT
How to send QTP test results to an email...(with out using Quality Center)?
if Object repository contain x and y properties. we do not know whether they are mandatory or assistive properties. While executing the script qtp will use both the properties or only sufficient properties to identify the object. It means it use OR (or) AND
Tell me few important difference Between QTP and WinRunner?
what is the use of VIRTUAL OBJECTS? explain ?
What is the registration process and examination fees?
What is the synchronization point in qtp?
Explain types of output values?
Given a string variable contain a full name (last name, first name), using vbscripting, how can you extract first and last name and save them into two different variables.