Is ICollection Empty - CSharp System.Collections

CSharp examples for System.Collections:ICollection

Description

Is ICollection Empty

Demo Code


using System.Collections.Generic;
using System.Collections;
using System;//from   w w w  .  j  a v a 2  s . co m

public class Main{
        public static bool IsEmpty<T>(ICollection<T> c)
        {
            return c == null || c.Count == 0;
        }
        public static bool IsEmpty(ICollection c)
        {
            return c == null || c.Count == 0;
        }
}

Related Tutorials