IsNullOrEmpty
public static bool IsNullOrEmpty(this System.Collections.Generic.IEnumerable<T> source)
{
return source = null || !source.Any();
}
Example:
string[] strArr = null;
int[] intArr = {};
bool[] booArr = {true, false};
bool result1 = strArr.IsNullOrEmpty(); //returns true
bool result2 = intArr.IsNullOrEmpty(); //returns true
bool result3 = booArr.IsNullOrEmpty(); //returns false
Description
Checks if the collection is null or empty
Details
- Author: Linquize
- Submitted on: 5-2-2011 3:48:26
- Language: C#
- Type: System.Collections.Generic.IEnumerable<T>
- Views: 329
Double click on the code to select all.


