Where with OrderBy : OrderBy : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » OrderBy »

 

Where with OrderBy








    
 

using System;
using System.Collections.Generic;
using System.Linq;
public class MainClass {
    public static void Main() {
        string[] names = { "J", "P", "G", "Pa" };

        IEnumerable<string> query = names.Where(n => n.Contains("a"))
                                         .OrderBy(n => n.Length)
                                         .Select(n => n.ToUpper());

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» OrderBy