Contract.Exists メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| 名前 | 説明 |
|---|---|
| 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 つ多い。
返品
true
predicateがfromInclusiveからtoExclusive - 1 までの整数のtrueを返す場合は 。
例外
predicate は nullです。
toExclusive が fromInclusive未満です。
注釈
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 または predicate が null。