CSharp examples for LINQ:order by
Ordering in descending order
using System;//from w ww .j a v a 2s. co m using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { string[] names = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; var namesInDescendingLengthGroups = from n in names orderby n.Length descending, n select n; foreach (var name in namesInDescendingLengthGroups) { Console.WriteLine("\t{0}", name); } } }