Go to: Synopsis. Return value. MEL examples.

Synopsis

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

Returns the index of the first occurrence of $item in $array, starting at element $index. If $item is not found then -1 is returned.

Return value

None

Arguments

Variable Name Variable Type Description
$itemstringThe string item to search for in the string array.
$indexintThe array index to begin the search at
$arraystring[]An array of string values.

MEL examples

	string $array[] = { "item1", "item2", "item3" };
	// Result: item1 item2 item3 //

	int $index = stringArrayFind( "item1", 0, $array );
	// Result: 0 // 

	$index = stringArrayFind( "item2", 0, $array );
	// Result: 1 // 

	$index = stringArrayFind( "item3", 4, $array );
	// Result: -1 // 

	$index = stringArrayFind( "blah", 0, $array );
	// Result: -1 //