OrderBy : OrderBy : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » OrderBy »

 

OrderBy








    
 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass {
    public static void Main() {

        string[] words = { "C", "a", "b" };

        var sortedWords =
            from w in words
            orderby w
            select w;

        Console.WriteLine("The sorted list of words:");
        foreach (var w in sortedWords) {
            Console.WriteLine(w);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» OrderBy