| 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 |
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)
// Signature:
Seq.contains : 'T -> seq<'T> -> bool
// Usage:
Seq.contains element sourceelement Type: 'T
The element to find.
source Type: seq<'T>
The input sequence.
| Exception | Condition |
|---|---|
| ArgumentNullException | Thrown when the input sequence is null. |
Evaluates to true if the given element is in the input sequence. Otherwise, it will return false.
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.
The following code shows how to use Seq.contains.
[!code-fsharpMain]
Output
true
false
Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2
F# Core Library Versions
Supported in: 4.0, Portable