How to combine 2 lists using LINQ?

后端 未结 3 1412
一向
一向 2021-02-02 09:15

Env.: .NET4 C#

Hi All,

I want to combine these 2 lists : { \"A\", \"B\", \"C\", \"D\" } and { \"1\", \"2\", \"3\" }

into this o

3条回答
  •  遇见更好的自我
    2021-02-02 09:29

    Use SelectMany when you want to form the Cartesian product of two lists:

    aList.SelectMany(a => bList.Select(b => a + b))

提交回复
热议问题