I'm a python guy and have recently started a C# project. One part of my code takes a myList = List<double[][]>
and needs to turn it into a myNewList = List<double[]>
to pass to another function.
So suppose myList
looks like this:
{{{0.0, 1.0}, {2.0, 3.0}}, {{4.0, 5.0}, {6.0, 7.0}}}
I want myNewList
to look like this:
{{0.0, 1.0}, {2.0, 3.0}, {4.0, 5.0}, {6.0, 7.0}}
In python, I would do this:
myNewList = list(itertools.chain.from_iterable(myList))
Now, I can very easily implement this with a foreach
loop and keep Add
ing to myNewList
, but does anyone know of a built-in way to do this?