LINQ Reverse Query Operator

By Peter Bromberg
INSTANTLY dtSearch TERABYTES OF POPULAR DATA TYPES; hundreds of reviews, etc.!

Inverts the order of the elements in a sequence.

char[] apple = { 'a', 'p', 'p', 'l', 'e' };

             char[] reversed = apple.Reverse().ToArray();

             foreach (char chr in reversed)
            {
               Console.Write(chr + " ");
            }
           Console.WriteLine();

            /*
             This code produces the following output:

             e l p p a
             */

LINQ Reverse Query Operator  (643 Views)