Use static method syntax to call the query operators. : Enumerable : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » Enumerable »

 

Use static method syntax to call the query operators.








    
 

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

        IEnumerable<string> filtered = Enumerable.Where(names,n => n.Contains("a"));
        IEnumerable<string> sorted = Enumerable.OrderBy(filtered, n => n.Length);
        IEnumerable<string> finalQuery = Enumerable.Select(sorted,n => n.ToUpper());

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» Enumerable