Gambas Documentation - /lang/instr

# InStr

Position = InStr ( String AS String , Substring AS String [ , Start AS Integer , Comparison AS Integer ] )

Returns the position of the first occurrence of Substring in String.

If Start is specified, the search begins at the position Start.

Comparison can be one of the following value:

- gb.Binary for a binary comparison (the default).

- gb.IgnoreCase for a case-insensitive comparison.

If the substring is not found, this function returns zero.

This function only deal with ASCII strings. To manipulate UTF-8 strings, use the String class.

### Examples

    PRINT Instr("Gambas is basic", "bas")

    4

    PRINT Instr("Gambas is basic", "bas", 5)

    11

    PRINT Instr("Gambas is basic", "not")

    0

### See also

- String Functions