c# - How to combine 2 lists using LINQ? -


env.: .net4 c#

hi all,

i want combine these 2 lists : { "a", "b", "c", "d" } , { "1", "2", "3" }

into one:

{ "a1", "a2", "a3", "b1", "b2", "b3", "c1", "c2", "c3", "d1", "d2", "d3" } 

obviously, use nested loops. wonder if linq can help. far understand, zip() not friend in case, right?

tia,

essentially, want generate cartesian product , concatenate elements of each 2-tuple. easiest in query-syntax:

var cartesianconcat = in seq1                       b in seq2                       select + b; 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -