using System;Output :
using System.Collections.Generic; using System.Linq; using System.Text;
namespace ConsoleApplication3
{
class Program
{
static void Main()
{
// An unsorted string array.
string[] letters = { "d", "c", "a", "b" };
var sorted = from letter in letters
orderby letter
select letter;
// Loop with the foreach keyword.
foreach (string value in sorted)
{
Console.WriteLine(value);
}
Console.ReadLine();
}
}
}
Tags:
csharp.net