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

Linq Where Indexed

7.5.2012 19:59:54
public void Linq5() {
string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var shortDigits = digits.Where((digit, index) => digit.Length < index);
Console.WriteLine("Short digits:");
foreach (var d in shortDigits)
{
Console.WriteLine("The word {0} is shorter than its value.", d);
}
}
public void Linq5() {    string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; var shortDigits = digits.Where((digit, index) => digit.Length < index); Console.WriteLine("Short digits:");    foreach (var d in shortDigits)    {        Console.WriteLine("The word {0} is shorter than its value.", d);    }} SONUÇ: Short digits: The word five is shorter than its value. The word six is shorter than its value. The word seven is shorter than its value. The word eight is shorter than its value. The word nine is shorter than its value.
Yorum yaz

Thanks, your message is sent successfully.