Search Results for

    Show / Hide Table of Contents

    Class EnumerableExtensions

    Extension methods for all concretions.

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

    Methods

    | Improve this Doc View Source

    CountO1<TSource>(IEnumerable<TSource>)

    Optimized version of , which runs in constant time on source of type System.String, System.Collections.IDictionary, and System.Collections.IList, and calls for any source which cannot be assigned to either of these types.

    Declaration
    public static int CountO1<TSource>(this IEnumerable<TSource> source)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source

    Returns
    Type Description
    System.Int32

    Type Parameters
    Name Description
    TSource

    | Improve this Doc View Source

    ElementAtO1<TSource>(IEnumerable<TSource>, Index)

    Optimized version of , which runs in constant time on source of type System.String, and System.Collections.IList, and calls for any source which cannot be assigned to either of these types.

    Declaration
    public static TSource ElementAtO1<TSource>(this IEnumerable<TSource> source, Index index)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source
    Index index
    Returns
    Type Description
    TSource
    Type Parameters
    Name Description
    TSource
    | Improve this Doc View Source

    ElementAtO1<TSource>(IEnumerable<TSource>, Int32)

    Optimized version of , which runs in constant time on source of type System.String, and System.Collections.IList, and calls for any source which cannot be assigned to either of these types.

    Declaration
    public static TSource ElementAtO1<TSource>(this IEnumerable<TSource> source, int index)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source
    System.Int32 index
    Returns
    Type Description
    TSource
    Type Parameters
    Name Description
    TSource
    | Improve this Doc View Source

    ElementAtO1OrDefault<TSource>(IEnumerable<TSource>, Int32)

    Optimized version of , which runs in constant time on source of type System.String, and System.Collections.IList, and calls for any source which cannot be assigned to either of these types.

    Declaration
    public static TSource ElementAtO1OrDefault<TSource>(this IEnumerable<TSource> source, int index)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source

    System.Int32 index

    Returns
    Type Description
    TSource

    Type Parameters
    Name Description
    TSource

    | Improve this Doc View Source

    EnumerateAtMostFirst<TSource>(IEnumerable<TSource>, Int32)

    Eagerly enumerates the first count items of source, or less if there aren't enough, returning an of them and the reminder, as a lazily evaluated .

    Declaration
    public static (IList<TSource> firstNItems, IEnumerable<TSource> reminder) EnumerateAtMostFirst<TSource>(this IEnumerable<TSource> source, int count)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source

    The to split into two pieces.

    System.Int32 count

    The number of items of source to eagerly evaluate and return (at most).

    Returns
    Type Description
    System.ValueTuple<System.Collections.IList<TSource>, System.Collections.IEnumerable<TSource>>

    A couple of an instance and an instance.

    Type Parameters
    Name Description
    TSource

    The type of elements of source.

    | Improve this Doc View Source

    EnumerateExactlyFirst<TSource>(IEnumerable<TSource>, Int32)

    Eagerly enumerates the first count items of source, returning an of them and the reminder, as a lazily evaluated .

    Declaration
    public static (IList<TSource> firstNItems, IEnumerable<TSource> reminder) EnumerateExactlyFirst<TSource>(this IEnumerable<TSource> source, int count)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source

    The to split into two pieces.

    System.Int32 count

    The number of items of source to eagerly evaluate and return.

    Returns
    Type Description
    System.ValueTuple<System.Collections.IList<TSource>, System.Collections.IEnumerable<TSource>>

    A couple of an instance and an instance.

    Type Parameters
    Name Description
    TSource

    The type of elements of source.

    | Improve this Doc View Source

    SkipO1<TSource>(IEnumerable<TSource>, Int32)

    Optimized version of , which runs in constant time on source of type System.String, and System.Collections.IList, and calls for any source which cannot be assigned to either of these types.

    Declaration
    public static IEnumerable<TSource> SkipO1<TSource>(this IEnumerable<TSource> source, int count)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TSource> source

    System.Int32 count

    Returns
    Type Description
    System.Collections.IEnumerable<TSource>

    Type Parameters
    Name Description
    TSource

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