I am trying to initialize a List<string>
array and while I have looked at other resources trying them made my compiler throw errors all the time.
I have seen this question, but it did not help.
My code is:
List<string>[] list = new List<string>[3];
list[1].Add("text");
I get the error on the second line. I have tried:
List<string>[] list = new List<string>[3]();
List<string>[] list = new List<string>()[3];
List<string>[] list = new List<string>()
{
new string("hh"),
new string("gg")
};
List<string>[] list = new List<string>()
{
"hh",
"gg"
};
But none of these work.