I create a list of list:
List<List<string>> C = new List<List<string>>();
Then assign some values to it. Assume the assignment is as follows:
List<string> B = new List<string>();
for (int j = 0; j < x; j++)
{
B.Clear();
for (int i = 0; i < y; i++)
B.Add(i.ToString());
C.Add(B);
}
x and y vary at each run of the code. So, I do not know them beforehand. (At this point of the code, I do not know how to find the size of C. I mean x and y, not x*y.)
I would like to assign/copy C to a 2D array, D[,]. Before the declaration of D, size of D (i.e., rows and columns that correspond to x and y) should have been calculated in some way by using C. How can I make the assignment?