Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Latest commit

 

History

History
81 lines (54 loc) · 1.81 KB

File metadata and controls

81 lines (54 loc) · 1.81 KB
title Seq.contains<'T> Function (F#)
description Seq.contains<'T> Function (F#)
keywords visual f#, f#, functional programming
author liboz
manager danielfe
ms.date 07/06/2016
ms.topic language-reference
ms.prod visual-studio-dev14
ms.technology devlang-fsharp
ms.assetid d17b835a-d48f-49a7-a2df-da02ba1c48b4

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

Evaluates to true if the given element is in the input sequence.

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

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

Syntax

// Signature:
Seq.contains : 'T -> seq<'T> -> bool

// Usage:
Seq.contains element source

Parameters

element Type: 'T

The element to find.

source Type: seq<'T>

The input sequence.

Exceptions

Exception Condition
ArgumentNullException Thrown when the input sequence is null.

Return Value

Evaluates to true if the given element is in the input sequence. Otherwise, it will return false.

Remarks

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

Example

The following code shows how to use Seq.contains.

[!code-fsharpMain]

Output

true
false

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#)