Answered Questions

  • How do you retrieve substring from another string in QTP

    Bhavin

    • Oct 18th, 2016

    Simplest Answer ever :

    Code
    1. Simplest answer ever:
    2. Dim objString
    3. objString = "This is the string"
    4.  
    5. Dim objFound
    6. objFound = "the string"
    7.  
    8. if Instr (objStr, objFound) Then
    9.     msgbox "String found"
    10. Else
    11.      msgbox "String not found"
    12. End If

    sneha

    • Mar 4th, 2015

    Code
    1. Dim StringValue="Country"
    2. SubstringValue=mid(StringValue,2,4)
    3.  
    4. msgbox SubstringValue
    5.  
    6. Returns Substring from starting position  2 and 4 character following
    7.  
    8. Returns "ount"
    9.