Go to: Synopsis. Return value. MEL examples.

Synopsis

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

Return the number of times the int in $item occurs in the int array $list. Zero is returned if the int is not in the list.

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, 2, 2 };
  // Result: item1 item2 item1 //
  int $count = intArrayCount( 1, $list );
  // Result: 1 //
  $count = intArrayCount( 2, $list );
  // Result: 3 //
  $count = intArrayCount( 4, $list );
  // Result: 0 //