Go to: Synopsis. Return value. MEL examples.

Synopsis

int intArrayContains(int $item, int[] $list)

Return true if array contains the item. The array may contain more than one occurrence of the item. This procedure will return true as soon as it finds one occurrence.

Return value

None

Arguments

Variable Name Variable Type Description
$itemintThe int item to search for in the int array.
$listint[]A list of int values.

MEL examples

  int $list[] = { 1, 2, 3 };
  // ,Result:, 1 2 3 // 

  int $found = intArrayContains( 1, $list );
  // Result: 1 //

  $found = intArrayContains( 2, $list );
  // Result: 1 //

  $found = intArrayContains( 0, $list );
  // Result: 0 //