Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Computing a Cartesian product or Combinations with LINQ

var s1 = new[] {a, b}; 
var s2 = new[] {x, y, z}; 
var product = 
    from first in s1 
    from second in s2 
    select new[] { first, second };
Source by ericlippert.com #
 
PREVIOUS NEXT
Tagged: #Computing #Cartesian #product #Combinations #LINQ
ADD COMMENT
Topic
Name
8+2 =