Generic ForEach For Multidimensional Array #49112
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.Runtime
Milestone
Background and Motivation
There is a method
Array.ForEach
existedpublic static void ForEach<T>(T[] array, Action<T> action);
and its input is specified on one dimensional array case. I want to propose another versionArray.ForEach
implementation for multidimensional array cases (ForEach([,], ...)
,ForEach([,,], ...)
andForEach([,,,], ...)
)Proposed API
Usage Examples
The usage examples which include one dimensional case, two dimensional case and three dimensional case are as below.
The output of the above tests:
Reference
The text was updated successfully, but these errors were encountered: