I want to know that is there any alternative solution available in Dot Net 3.0 for Enumerable.Zip
.
Here is the example that I want to implement:
I'm having two list of string.
var list1 = new string[] { "1", "2", "3" };
var list2 = new string[] { "a", "b", "c" };
I want to combine these lists, in such a way that it returns output like this:
{(1,a), (2,b), (3,c)}
I know, I can do this my using Zip
in Dot Net >= 4.0. Using this way:
list1.Zip(list2, (x, y) => new Tuple<int, string>(x, y));
But, my problem is that I want to do the same in Dot Net 3.0. Is there any alternative method available in Dot Net <= 3.0 or I've to create custom method?