linq Reverse

linq Reverse

public static void Reverse()
        {
            string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };

            var reversedIDigits = (from d in digits
                                   where d[1] == 'i'
                                   select d).Reverse();

            Console.WriteLine("A backwards list of the digits with a second character of 'i':");
            foreach (var d in reversedIDigits)
            {
                Console.WriteLine("{0}", d);
            }
        }
Output
linq Reverse linq Reverse Reviewed by Bhaumik Patel on 6:58 PM Rating: 5