Table of Contents

Method GetNotNull

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetNotNull<T>(T?[]?)

Returns a new array containing all non-null elements from the specified array of nullable values.

public static T[] GetNotNull<T>(T?[]? values) where T : class

Parameters

values T[]

An array of nullable values to filter. May be null or empty.

Returns

T[]

An array containing all non-null elements from the input array, in their original order. Returns an empty array if the input is null, empty, or contains only null elements.

Type Parameters

T

The type of the elements in the input and result arrays. Must be a non-nullable value or reference type.

Remarks

The returned array will not contain any null elements. If the input array contains no non-null values, the result is an empty array. The method preserves the order of non-null elements from the input array.