Linq Example 13 - Reverse

4:44 AM
Linq Query:

   //Reverse
            string[] alphabets = { "h", "b", "m", "q", "v", "p", "a", "c" };
            var reversed = alphabets.Reverse();

            foreach (var t in reversed)
            {
                Console.WriteLine(t.ToString());
            }




Output:

c
a
p
v
q
m
b
h




0 comments:

Post a Comment