Automation testing QTP with VB Script functions interview questions


Total available count: 68
Subject - Software Testing
Subsubject - Automation testing QTP with VB Script functions

InStr Function?

InStr function returns the position of the first occurrence of one string within another.

Syntax: InStr([start, ]string1, string2[, compare])

Arguments:
start: (Optional) Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. If start contains Null, an error occurs. The start argument is required if compare is specified. 
string1: (Required) String expression being searched.
string2: (Required) String expression searched for compare (Optional) Numeric value indicating the kind of comparison to use when evaluating substrings. 

Example: 

Str="How do you DO ?"
'InStr
Print Instr(1, Str, "DO", 1)                
Output: 5 , which means  it found the string in 5th position for  textual comparison
Print Instr(1, Str, "DO", 0)                
Output: 12 , which means  it found the string in 12th position for binary comparison
Print Instr(6, Str, "do", 0)                    
Output: 0 , which means  it  didnot found the string after the 6th position   for binary comparison


 




Next 5 interview question(s)

1
InStrRev Function?
2
IsArray Function?
3
LBound Function?
4
LCase Function?
5
Left Function?


Comments