Return an Empty Sequence of Strings : Enumerable.Empty « LINQ « C# / C Sharp






Return an Empty Sequence of Strings

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

public class MainClass {
    public static void Main() {
        IEnumerable<string> strings = Enumerable.Empty<string>();
        foreach (string s in strings)
            Console.WriteLine(s); Console.WriteLine(strings.Count());
    }
}

 








Related examples in the same category