ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
Is there a function to find the number of occurrences of sub
strings within a string?
 Question Submitted By :: Uday Kumar_anem
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Is there a function to find the number of occurrences of sub strings within a string?
Answer
# 1
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 ?    1 Yes 0 No
Nath T
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
How to create runtime property for an object?  6
What is Virtual object wizard in QTP?  3
How to get data line by line from web element  1
How to handle Recovery scenario in QTP. give detailed explanation about recovery scenario.  1
What is the D/B Test managemet tool and bug trcking tool? Ans send to pbr.qtp@gmail.com Cap-Gemini1
How i can use and create Library functions in QTP and what is the proces .  1
what is difference between wait and synchronization point. Intel3
what is Synchronization point in QTP?Can anybody give a perfect example on it Thanks in advance  5
Explain about invoking of application?  2
How can I generate customized logs in QTP ? Ordain-Solutions1
In Descriptive programing if i use this below code will it work for login window or flight Res Window. Shud i add the properties like attached text=login and text=Agent Name in the object repository and define a new object first. Pls tell me the procedure in clear inorder to execute this script. Dialog("title:=Login").WinEdit("attached text:=Agent Name:").set"agent123" Dialog("title:=Login").WinEdit("attached text:=Password:").set"mercury" Dialog("attached text:=Login").winbutton("text:=OK").click  2
What is the difference between two actions? Wipro1
Which MS Excel formulas are possible to use in the DataTable? I am searching a formula for searching a field in the datatable HP2
how to load the *.vbs (or) test generating script in a new machine? Ordain-Solutions3
When we parameterise some field ex. Textbox is there any way that we can generate a specefic number of random values (For alphabetical values if possible) instead of manually entering values in the data table  2
What are Error handling other than Recovery scenario manager?  2
what is descriptive.create()in qtp?  3
what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ? Covansys2
Can you do more than just capture and playback?  2
Can we add the function library directly from scripting in qtp instead of adding from resource tab? IBM3
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com