.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> LINQ >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Simple LINQ query on a Collection

Posted By:Sajid P K       Posted Date: October 18, 2010    Points: 15    Category: LINQ    URL: http://www.dotnetspark.com  

This code demonstrates use of LINQ query. This will retunes strings from a array of strings, which having its length greater than Five

static void Main(string[] args)  
      string []myNames = {"saji","sajid","sa","sajdipk"};             
      IEnumerable query = from name in myNames
                          where name.Length < 5
                          select name;    

     foreach(string n in query)          


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend