ListExtensions.For<T>

Extension Method in ListExtensions

Declaration

public static void For<T>(this List<T> list, Action<(T item, int index)> action)

Description

Invokes an action for each item in the list. The item and index are passed as parameters.

Type Parameters

TThe type of the list.

Parameters

listThe list to iterate over.
actionThe action to invoke.