- using System;
- public class ReverseArray
- {
- public static void Main()
- {
- string[] strings = {"beta", "alpha", "gamma"};
- Console.WriteLine ("Array elements: ");
- DisplayArray (strings);
- Array.Reverse (strings); // Reverse element order
- DisplayArray (strings);
- }
- public static void DisplayArray (Array array)
- {
- foreach (object o in array)
- {
- Console.Write ("{0} ", o);
- }
- Console.WriteLine();
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/060620133845.html
来源: http://www.codesnippet.cn/detail/060620133845.html