Is IEnumerable Empty - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:IEnumerable

Description

Is IEnumerable Empty

Demo Code


using System.Text.RegularExpressions;
using System.Collections;
using System;//from w ww  .j a v  a2  s  .  co m

public class Main{
    public static bool IsEmpty(this IEnumerable enumerable)
      {
         foreach (object o in enumerable)
         {
            return false;
         }
         return true;
      }
}

Related Tutorials