ArrayExtensions.For<T>

Extension Method in ArrayExtensions

Declaration

public static void For<T>(this T[] array, Action<(T element, int index)> action)

Description

Invokes an action for each element in the array. The element and index are passed as parameters.

Type Parameters

TThe type of the array.

Parameters

arrayThe array to iterate over.
actionThe action to invoke.