AsyncEnumerable.SkipLast<TSource> Method

Definition

Returns a new sequence that contains the elements from source with the last count elements of the source collection omitted.

C#
public static System.Collections.Generic.IAsyncEnumerable<TSource> SkipLast<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, int count);

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IAsyncEnumerable<TSource>

An IAsyncEnumerable<T> to return elements from.

count
Int32

The number of elements to omit from the end of the sequence.

Returns

IAsyncEnumerable<TSource>

A new sequence that contains the elements from source minus count elements from the end of the sequence.

Exceptions

source is null.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided), 10
.NET Standard 2.0 (package-provided)