SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method Return

    | Edit this page

    Return<T>(T)

    Returns a single-element sequence containing the item provided.

    Declaration
    public static IEnumerable<T> Return<T>(T item)
    Parameters
    Type Name Description
    T item

    The item to return in a sequence.

    Returns
    Type Description
    IEnumerable<T>

    A sequence containing only item.

    Type Parameters
    Name Description
    T

    The type of the item.

    Examples

    The following code example demonstrates how to return a single element as a sequence using Return.

    // Return a sequence of a single element
    var result = SuperEnumerable.Return(123);
    
    Console.WriteLine(
        "[" + 
        string.Join(", ", result) +
        "]");
    
    // This code produces the following output:
    // [123]
    
    © SuperLinq Authors. All rights reserved.