EnumerableExtensions.

IsNullOrEmpty<T>(T[]) Method

Summary

Checks whether specified array is null or contains no elements

Syntax

public static bool IsNullOrEmpty<T>(this T[] source)

Examples

Replace
collection == null || collection.Length == 0
with
collection.IsNullOrEmpty()

Type Parameters

Name Description
T the item type

Parameters

Name Type Description
source T[] the array

Return Value

Type Description
bool true if element null or empty, else false