Performs the passed action on each item in the collection.

Namespace: Reimers.Core
Assembly: Reimers.Core (in Reimers.Core.dll) Version: 5.3.95.699 (5.3.95.699)

Syntax

C#
public static void ForEach<T>(
	this IEnumerable<T> collection,
	Action<T> action
)

Parameters

collection
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'T>)>)>
The IEnumerable<(Of <(<'T>)>)> to iterate over.
action
Type: System..::..Action<(Of <(<'T>)>)>
The Action to perform.

Type Parameters

T
The Type of items in the collection.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also