Are 2 dimensional Lists possible in c#?

后端 未结 9 1597
走了就别回头了
走了就别回头了 2020-11-27 12:44

I\'d like to set up a multidimensional list. For reference, I am working on a playlist analyzer.

I have a file/file-list, which my program saves in a standard list.

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 13:19

    You can also..do in this way,

    List> Parent=new  List>();
    
    List Child=new List();
    child.Add(2349);
    child.Add("Daft Punk");
    child.Add("Human");
    .
    .
    Parent.Add(child);
    
    
    

    if you need another item(child), create a new instance of child,

    Child=new List();
    child.Add(2323);
    child.Add("asds");
    child.Add("jshds");
    .
    .
    Parent.Add(child);
    
        

    提交回复
    热议问题