ArrayExtensions.LastNonNull<T>

Extension Method in ArrayExtensions

Declaration

public static T LastNonNull<T>(this T[] array)
    where T : class

Description

Returns the last non-null element in the array.

Type Parameters

TThe type of the array.

Parameters

arrayThe array to get the element from.

Returns

TThe last non-null element in the array, or default(T) if all elements are null.