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

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

Mark Seemann|Last Updated: 8/18/2017
|
2 Contributors

Computes the nth element in the collection.

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

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

Syntax

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

// Usage:
Seq.item index source

Parameters

index Type: int

The zero-based index of the element to retrieve.

source Type: seq<'T>

The input sequence.

Return Value

The result sequence.

Remarks

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

Example

let secondItem = seq { yield "foo"; yield "bar"; yield "baz" } |> Seq.item 1
printfn "%s" secondItem

Output:

bar

Platforms

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

Version Information

F# Core Library Versions

Supported in: 4.0, Portable

See Also

Collections.Seq Module (F#)

Microsoft.FSharp.Collections Namespace (F#)

© 2018 Microsoft