Show / Hide Table of Contents

    Class EnumerableExtensions

    Extensions for IEnumerable<T> that don't currently exist in System.Linq.

    Inheritance
    Object
    EnumerableExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: IPA.Utilities
    Assembly: IPA.Loader.dll
    Syntax
    public static class EnumerableExtensions

    Methods

    | Improve this Doc View Source

    Append<T>(IEnumerable<T>, T)

    Adds a value to the end of the sequence.

    Declaration
    public static IEnumerable<T> Append<T>(this IEnumerable<T> seq, T app)
    Parameters
    Type Name Description
    IEnumerable<T> seq

    a sequence of values

    T app

    the value to append to seq

    Returns
    Type Description
    IEnumerable<T>

    a new sequence ending with app

    Type Parameters
    Name Description
    T

    the type of the elements of seq

    | Improve this Doc View Source

    NonNull<T>(IEnumerable<T>)

    LINQ extension method that filters null elements out of an enumeration.

    Declaration
    public static IEnumerable<T> NonNull<T>(this IEnumerable<T> self)
        where T : class
    Parameters
    Type Name Description
    IEnumerable<T> self

    the enumeration to filter

    Returns
    Type Description
    IEnumerable<T>

    a filtered enumerable

    Type Parameters
    Name Description
    T

    the type of the enumeration

    | Improve this Doc View Source

    NonNull<T>(IEnumerable<Nullable<T>>)

    LINQ extension method that filters null elements from an enumeration of nullable types.

    Declaration
    public static IEnumerable<T> NonNull<T>(this IEnumerable<T?> self)
        where T : struct
    Parameters
    Type Name Description
    IEnumerable<Nullable<T>> self

    the enumeration to filter

    Returns
    Type Description
    IEnumerable<T>

    a filtered enumerable

    Type Parameters
    Name Description
    T

    the underlying type of the nullable enumeration

    | Improve this Doc View Source

    NonNull<T, U>(IEnumerable<T>, Func<T, U>)

    LINQ extension method that filters null elements out of an enumeration based on a converter.

    Declaration
    public static IEnumerable<T> NonNull<T, U>(this IEnumerable<T> self, Func<T, U> pred)
        where U : class
    Parameters
    Type Name Description
    IEnumerable<T> self

    the enumeration to filter

    Func<T, U> pred

    the predicate to select for filtering

    Returns
    Type Description
    IEnumerable<T>

    a filtered enumerable

    Type Parameters
    Name Description
    T

    the type of the enumeration

    U

    the type to compare to null

    | Improve this Doc View Source

    Prepend<T>(IEnumerable<T>, T)

    Adds a value to the beginning of the sequence.

    Declaration
    public static IEnumerable<T> Prepend<T>(this IEnumerable<T> seq, T prep)
    Parameters
    Type Name Description
    IEnumerable<T> seq

    a sequence of values

    T prep

    the value to prepend to seq

    Returns
    Type Description
    IEnumerable<T>

    a new sequence beginning with prep

    Type Parameters
    Name Description
    T

    the type of the elements of seq

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX