Is there a function in the .NET library that will return true or false as to whether an array is null or empty? (Similar to string.IsNullOrEmpty
).
I had a look in the Array
class for a function such as this but couldn't see anything.
i.e.
var a = new string[]{};
string[] b = null;
var c = new string[]{"hello"};
IsNullOrEmpty(a); //returns true
IsNullOrEmpty(b); //returns true
IsNullOrEmpty(c); //returns false