Query string array by its element length : Query : XML LINQ C# Source Code


Custom Search

C# Source Code » XML LINQ » Query »

 

Query string array by its element length








    
 
using System;
using System.Linq;

class HelloWorld {
    static void Main() {
        string[] words = { "hello", "wonderful", "linq", "beautiful", "world" };
        var shortWords = from word in words
                         where word.Length <= 5
                         select word;

        foreach (var word in shortWords)
            Console.WriteLine(word);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo XML LINQ
» Query