Transformation: link two array.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
int[] numbers = { 5, 4, 1};
string[] strings = { "zero", "one", "two"};
var textNums =
from n in numbers
select strings[n];
Console.WriteLine("Number strings:");
foreach (var s in textNums) {
Console.WriteLine(s);
}
}
}
Related examples in the same category