Previous Topic

Next Topic

InStr - MaxBasic Function

InStr(String1: String, String2: String): Number

String position. Returns the position of the start of the first instance of String2 contained within String1. If String2 is not found in String1 or String1 is zero length, 0 is returned. If either argument is null, null is returned.

Instr function syntax has these named arguments:

Parameter

Description

String 1

Required. String to be searched for String 2.

String 2

Required. String to search for in String 1.

Sample code:

  Print Instr("caterpillar", "pill")

Returns: 6

See Also

String Functions

Book Contents

Book Index