Go to: Synopsis. Return value. MEL examples.
int stringArrayFind(string $item, int $index, string[] $array)
None
Variable Name | Variable Type | Description |
---|---|---|
$item | string | The string item to search for in the string array. |
$index | int | The array index to begin the search at |
$array | string[] | An array of string values. |
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 //