Contract.Exists 메서드

정의

오버로드

Exists(Int32, Int32, Predicate<Int32>)

정수 범위 내의 정수에 대해 지정된 테스트가 true인지 여부를 확인합니다.

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

요소 컬렉션에 속하는 요소가 함수에 존재하는지 확인합니다.

Exists(Int32, Int32, Predicate<Int32>)

Source:
Contracts.cs
Source:
Contracts.cs
Source:
Contracts.cs

정수 범위 내의 정수에 대해 지정된 테스트가 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>

지정된 범위에 있는 정수의 값을 평가하기 위한 함수입니다.

반환

predicatefromInclusive부터 toExclusive - 1 사이의 정수에 대해 true를 반환하면 true입니다.

예외

predicate이(가) null인 경우

toExclusivefromInclusive보다 작은 경우

설명

toExclusive 매개 변수는 0부터 시작하는 정수 범위의 길이를 쉽게 사용할 수 있도록 마지막 정수보다 1개 이상입니다. 예를 들어 정수 0~4의 경우 5로 설정됩니다.

적용 대상

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

Source:
Contracts.cs
Source:
Contracts.cs
Source:
Contracts.cs

요소 컬렉션에 속하는 요소가 함수에 존재하는지 확인합니다.

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>

에 전달할 predicate형식 T 의 요소를 그릴 컬렉션입니다.

predicate
Predicate<T>

collection에 있는 요소를 평가하기 위한 함수입니다.

반환

predicateT에서 collection 형식의 요소에 대해 true를 반환하는 경우에만 true입니다.

예외

collection 또는 predicatenull인 경우

추가 정보

적용 대상