13 lines
410 B
C#
13 lines
410 B
C#
namespace PkmnLib.Static.Utils;
|
|
|
|
/// <summary>
|
|
/// Extension methods for <see cref="IEnumerable{T}"/>.
|
|
/// </summary>
|
|
public static class EnumerableHelpers
|
|
{
|
|
/// <summary>
|
|
/// Returns all elements of the enumerable that are not null.
|
|
/// </summary>
|
|
public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> enumerable) where T : class =>
|
|
enumerable.Where(x => x is not null)!;
|
|
} |