I am trying to create a vector of two positions, where in each position I add a two-dimensional matrix of type string
, which led me to create a list of two-dimensional arrays as follows:
List<String[,]> multi = new List<string[,]>();
Then create my bidimensional matrix and add the values as follows just as an example:
string[,] m2 = new string[2, 2];
m2[0, 0] = "jose";
m2[0, 1] = "juan";
m2[1, 0] = "luis";
m2[1, 1] = "pedro";
then add that matrix to the list as follows:
multi.Add(m2);
The problem here is that when I want to pass my list to array
with the toArray()
method in the following way, it marks me error:
string[] main = multi.ToArray();
The question is: How can I make it so that this list becomes a array
?