A Query Using the Standard Dot Notation Syntax

image_pdfimage_print
   
 


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

        string[] names = { "A1", "B123", "C123123", "E", "W" };

        IEnumerable<string> sequence = names
         .Where(n => n.Length < 6)
         .Select(n => n);

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

    


This entry was posted in LINQ. Bookmark the permalink.