Filter string by its length : where : LINQ C# Source Code


Custom Search

C# Source Code » LINQ » where »

 

Filter string by its length








    
 

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

class LinqDemo {
    static void Main() {
        string[] names = { "Tom", "Dick", "Harry" };


        IEnumerable<string> filteredNames = names.Where(n => n.Length >= 4);
        foreach (string name in filteredNames) Console.Write(name + "|");
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo LINQ
» where