I do not think you need a library. I think LINQ does everything you say well enough.
Creating one array from another
int[,] parts = new int[2,3]; int[] flatArray = parts.ToArray();
Simple iteration
int[,] parts = new int[2,3]; foreach(var item in parts) Console.WriteLine(item);
Array slicing
int[] arr = new int[] { 2,3,4,5,6 }; int[] slice = arr.Skip(2).Take(2).ToArray(); // Multidimensional slice int[,] parts = new int[2,3]; int[] slice = arr.Cast<int>().Skip(2).Take(2).ToArray();
The .Cast<int> in the last example is due to the quirk that multidimensional arrays in C # are only IEnumerable and not IEnumerable<T> .
driis
source share