Contract.Exists メソッド

定義

オーバーロード

名前 説明
Exists(Int32, Int32, Predicate<Int32>)

指定したテストが整数の範囲内の任意の整数に対して true かどうかを判断します。

Exists<T>(IEnumerable<T>, Predicate<T>)

要素のコレクション内の要素が関数内に存在するかどうかを判断します。

Exists(Int32, Int32, Predicate<Int32>)

指定したテストが整数の範囲内の任意の整数に対して true かどうかを判断します。

public:
 static bool Exists(int fromInclusive, int toExclusive, Predicate<int> ^ predicate);
public static bool Exists(int fromInclusive, int toExclusive, Predicate<int> predicate);
static member Exists : int * int * Predicate<int> -> bool
Public Shared Function Exists (fromInclusive As Integer, toExclusive As Integer, predicate As Predicate(Of Integer)) As Boolean

パラメーター

fromInclusive
Int32

predicateに渡す最初の整数。

toExclusive
Int32

predicateに渡す最後の整数より 1 つ多い。

predicate
Predicate<Int32>

指定した範囲内の整数の任意の値を評価する関数。

返品

true predicatefromInclusiveからtoExclusive - 1 までの整数のtrueを返す場合は 。

例外

predicatenullです。

toExclusivefromInclusive未満です。

注釈

toExclusive パラメーターは、0 から始まる整数の範囲の長さを使用しやすくするために、最後の整数より 1 つ多い値です。 たとえば、整数 0 から 4 の場合は 5 に設定されます。

こちらもご覧ください

適用対象

Exists<T>(IEnumerable<T>, Predicate<T>)

要素のコレクション内の要素が関数内に存在するかどうかを判断します。

public:
generic <typename T>
 static bool Exists(System::Collections::Generic::IEnumerable<T> ^ collection, Predicate<T> ^ predicate);
public static bool Exists<T>(System.Collections.Generic.IEnumerable<T> collection, Predicate<T> predicate);
static member Exists : seq<'T> * Predicate<'T> -> bool
Public Shared Function Exists(Of T) (collection As IEnumerable(Of T), predicate As Predicate(Of T)) As Boolean

型パラメーター

T

collectionに含まれる型。

パラメーター

collection
IEnumerable<T>

T型の要素を描画してpredicateに渡すコレクション。

predicate
Predicate<T>

collection内の要素に対して評価する関数。

返品

true if and only if and only if predicate returns true for any element of type T in collection.

例外

collection または predicatenull

こちらもご覧ください

適用対象