Hasan Akpürüm
Kıdemli Yazılım Danışmanı
Makele Detayı

Linq Select Transformation

9/23/2013 2:13:03 PM
public void Linq8() {
    int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
    string[] strings = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };

    var textNums =
        from num in numbers
        select strings[num];

    Console.WriteLine("Number strings:");
    foreach (var str in textNums) {
        Console.WriteLine(str);
    }
}
Sonuç :
Number strings:
five
four
one
three
nine
eight
six
seven
two
zero
Yorum yaz

Thanks, your message is sent successfully.