Reverse an string array in CSharp
Description
The following code shows how to reverse an string array.
Example
using System;//from www . j ava 2 s. c om
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
public static void Main() {
string[] presidents = {"CSS", "HTML", "Java", "HTML5", "Wallet", "Javascript"};
IEnumerable<string> items = presidents.Reverse();
foreach (string item in items)
Console.WriteLine(item);
}
}
The code above generates the following result.