Enumerable.SkipLast<TSource>(IEnumerable<TSource>, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個新的可枚舉集合,包含 的 source 元素,且刪除原始集合的最後元素 count 。
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Generic::IEnumerable<TSource> ^ SkipLast(System::Collections::Generic::IEnumerable<TSource> ^ source, int count);
public static System.Collections.Generic.IEnumerable<TSource> SkipLast<TSource>(this System.Collections.Generic.IEnumerable<TSource> source, int count);
static member SkipLast : seq<'Source> * int -> seq<'Source>
<Extension()>
Public Function SkipLast(Of TSource) (source As IEnumerable(Of TSource), count As Integer) As IEnumerable(Of TSource)
類型參數
- TSource
可枚舉集合中元素的類型。
參數
- source
- IEnumerable<TSource>
一個可枚舉的集合實例。
- count
- Int32
集合末尾可省略的元素數量。
傳回
IEnumerable<TSource>
一個新的可枚舉集合,包含集合末尾的元素source。count
例外狀況
source 是 null。
備註
若 count 不是正數,此方法回 source 傳的可枚舉集合的副本相同。