c# - What is the use of Enumerable.Zip extension method in Linq? -
what use of enumerable.zip
extension method in linq?
the zip operator merges corresponding elements of 2 sequences using specified selector function.
var letters= new string[] { "a", "b", "c", "d", "e" }; var numbers= new int[] { 1, 2, 3 }; var q = letters.zip(numbers, (l, n) => l + n.tostring()); foreach (var s in q) console.writeline(s);
ouput
a1 b2 c3
Comments
Post a Comment