Add ForEach extension method on IEnumerable
This commit is contained in:
12
src/Extensions.cs
Normal file
12
src/Extensions.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
namespace aoc2021;
|
||||||
|
|
||||||
|
internal static class Extensions
|
||||||
|
{
|
||||||
|
public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
|
||||||
|
{
|
||||||
|
foreach (T item in enumeration)
|
||||||
|
{
|
||||||
|
action(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user