I'll keep this simple. My dataset is as follows:
Array 1:
James
Bob
Jim
Array 2:
0
1
2
I want to create a new array by joining the two arrays so they produce something like the following:
James 0
James 1
James 2
Bob 0
Bob 1
Bob 2
Jim 0
Jim 1
Jim 2
How can it be done in C#. I've came into this problem before, I remember using extension methods but I have no idea what area of Set Theory this falls under.
You're looking for a cross product:
from a in a1
from b in a2
select new { a, b }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With