CSharp examples for System:Array Element
Determines whether all elements of a sequence are set to the default value of .
using System.Linq; using System;//w ww . ja v a 2 s . c om public class Main{ /// <summary> /// Determines whether all elements of a sequence are set to the default value of <see cref="T"/>. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="array"></param> /// <returns></returns> public static bool AllDefault<T>(this Array array) { return array.Cast<T>().AllDefault(); } }