Mega Code Archive

 
Categories / C# Book / 04 LINQ
 

0398 Empty

Empty manufactures an empty sequence and requires just a type argument: using System; using System.Collections; using System.Collections.Generic; using System.Linq; class Program { static void Main() { foreach (string s in Enumerable.Empty<string>()) { Console.Write(s); // <nothing> } } }