how to copy a list to a new list, or retrieve list by value in c#

后端 未结 7 2067
死守一世寂寞
死守一世寂寞 2021-01-03 22:06

I noticed in c# there is a method for Lists: CopyTo -> that copies to arrays, is there a nicer way to copy to a new list? problem is, I want to retrieve the list by value to

相关标签:
7条回答
  • 2021-01-03 23:12

    Just create a new List and use the appropriate constructor:

    IList<Obj> newList = new List<Obj>(oldList);
    
    0 讨论(0)
提交回复
热议问题