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).
string.IsNullOrEmpty
I had
Since C# 6.0, the null-propagation operator may be used to express concise like this:
if (array?.Count.Equals(0) ?? true)
Note 1: ?? false is necessary, because of the following reason Note 2: as a bonus, the statement is also "thread-safe"
Note 1: ?? false is necessary, because of the following reason
?? false
Note 2: as a bonus, the statement is also "thread-safe"