Query Using the Query Expression Syntax : where : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » where »

 

Query Using the Query Expression Syntax








    
 


using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
    public static void Main() {

        string[] names = { "A123123", "B123", "C123123", "E123", "W" };
        IEnumerable<string> sequence = from n in names
                                       where n.Length < 6
                                       select n;

        foreach (string name in sequence) {
            Console.WriteLine("{0}", name);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» where