Go to: Synopsis. Return value. MEL examples.

Synopsis

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

Remove the int items in the first int array from the second int array. A new int array with the items removed is returned. The second argument is left unchanged.

Note that all occurrences of the given int items will be removed from the int array, not just the first occurrence.

Return value

None

Arguments

Variable Name Variable Type Description
$itemsint[]A list of int values to remove from the int array.
$listint[]The array to be acted upon.

MEL examples

  int $list[]  = { 1, 2, 3, 4, 5, 6, 7, 8 };
  int $items[] = { 1, 3, 5, 7 };
  int $diff[] = intArrayRemove($items, $list);
  // Result : { 2, 4, 6, 8 } //