InStr Function


InStr( numbegin, string1, string2 )

Returns the character position of the first occurrence of string2 within string1.

The numbegin parameter is not optional and sets the starting point of the search.  numbegin must be a valid positive integer no greater than 65,535.

string1 is the string being searched and string2 is the string we are looking for.

Example:

    Sub Main

        B$ = "Good Bye"

        A% = InStr(2, B$, "Bye")

        C% = Instr(3, B$, "Bye")

    End Sub


Related Topic:

Mid Function