Table of contents
Collapse the table of content
Expand the table of content

Seq.skip<'T> Function (F#)

Den Delimarsky|Last Updated: 7/25/2016
1 Contributor

Returns a sequence that skips N elements of the underlying sequence and then yields the remaining elements of the sequence.

Namespace/Module Path: Microsoft.FSharp.Collections.Seq

Assembly: FSharp.Core (in FSharp.Core.dll)


// Signature:
Seq.skip : int -> seq<'T> -> seq<'T>

// Usage:
Seq.skip count source


count Type: int

The number of items to skip.

source Type: seq<'T>

The input sequence.


ArgumentNullExceptionThrown when the input sequence is null.
InvalidOperationExceptionThrown when count exceeds the number of elements in the sequence.

Return Value

The result sequence.


This function is named Skip in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.


The following example demonstrates the use of Seq.skip to skip the first five squares of a list of squares.

    let mySeq = seq { for i in 1 .. 10 -> i*i }
    let printSeq seq1 = Seq.iter (printf "%A ") seq1; printfn ""
    let mySeqSkipFirst5 = Seq.skip 5 mySeq
    mySeqSkipFirst5 |> printSeq
36 49 64 81 100


Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Collections.Seq Module (F#)

Microsoft.FSharp.Collections Namespace (F#)

© 2016 Microsoft