InStr function returns the position of the first occurrence of one string within another.
Syntax: InStr([start, ]string1, string2[, compare])
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.
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