I need to convert an array int[][] to List<List<int>>. Is it possible and how?
Array[index].Length can be 0.
First, i tried to do like this: List<List<int>> ListName = new List<List<int>>(ArrayName); but it didn't work. Then, I tried to use LINQ like List<List<int>> ListName = ArrayName.OfType<List<int>>().ToList(); but it also didn't work. I searched in internet about this, but everywhere articles are saying about converting int[] to List<int>.
articles are saying about converting
int[]toList<int>That's the right idea, but you need to do it for the inner and outer arrays. Something like this:
That should get you what you need!