Im new in C# I just want to know if it's possible to initialize an array of arrays with the same value using Enumerable, what I'm trying to do is something like this:
Enumerable.Range(1, 8).Select(i => {-1, -1}).ToArray();
or using Repeat
Enumerable.Repeat({ -1, -1}, 8).ToArray();
My desired output would be an array with this shape and values:
{{-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1} };
- Can this be achieved using Enumerable?
- Is there any other "short" way to do this?
Thanks for your help.