Multi-dimensional arraylist or list in C#?

前端 未结 5 1801
面向向阳花
面向向阳花 2020-12-03 00:07

Is it possible to create a multidimensional list in C#? I can create an multidimensional array like so:

 string[,] results = new string[20, 2];
5条回答
  •  一生所求
    2020-12-03 00:43

    Depending on your exact requirements, you may do best with a jagged array of sorts with:

    List[] results = new { new List(), new List() };
    

    Or you may do well with a list of lists or some other such construct.

提交回复
热议问题