public class Example
{
public static void Main()
{
Console.Write("<< Linq - Zip 기본 예제 >> \n");
// An int array with 7 elements.
IEnumerable<int> numbers = new[]
{
1, 2, 3, 4, 5, 6, 7
};
// A char array with 6 elements.
IEnumerable<string> letters = new[]
{
"Code", "killer", "Codekiller", "house", "horse", "letters"
};
foreach ((int number, string letter) in numbers.Zip(letters))
{
Console.WriteLine($"Number: {number} zipped with letter: {letter}");
}
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}