Mega Code Archive

 
Categories / C# Tutorial / LINQ
 

Linq Over Array Using Sequence

using System; using System.Collections.Generic; using System.Text; using System.Xml.Linq; using System.Linq;     class Program     {         static void Main(string[] args)         {             string[] currentVideoGames = {"test", "this is a test", "asdf", "game 1","game 2", "game 3"};             var subset = from g in currentVideoGames where g.Length > 6 orderby g select g;             foreach (var s in subset)                 Console.WriteLine("Item: {0}", s);         }     }