Concatenate multiple IEnumerable

前端 未结 4 1391
鱼传尺愫
鱼传尺愫 2021-01-07 18:11

I\'m trying to implement a method to concatenate multiple Lists e.g.

List l1 = new List { \"1\", \"2\" };
List

        
4条回答
  •  情话喂你
    2021-01-07 19:00

    All you have to do is to change:

    public static IEnumerable Concatenate(params IEnumerable lists)
    

    to

    public static IEnumerable Concatenate(params IEnumerable[] lists)
    

    Note the extra [].

提交回复
热议问题