Go to: Synopsis. Return value. MEL examples.

Synopsis

int stringArrayFind(string $item, int $index, string[] $list)

Return the index of item if it is in the array and -1 otherwise. The array may contain more than one occurrence of the item. This procedure will return the index of the first occurence of item starting at index.

Return value

None

Arguments

Variable Name Variable Type Description
$itemstringThe string item to search for in the string array.
$indexstringThe array index to begin the search at
$liststring[]A list of string values.

MEL examples

	string $list[] = { "item1", "item2", "item3" };
	// ,Result:, 1.0 2.0 3.0 // 
	int $index = stringArrayFind( "item1", 0, $list );
	// ,Result:, 0 // 
	$index = stringArrayFind( "item2", 0, $list );
	// ,Result:, 1 // 
	$index = stringArrayFind( "item3", 4, $list );
	// ,Result:, -1 // 
	$index = stringArrayFind( "blah", 0, $list );
	// ,Result:, -1 //