System.Generics.Collections.TArray.Contains
Delphi
class function Contains<T>(const Values: array of T; const Item: T): Boolean; overload; static;
class function Contains<T>(const Values: array of T; const Item: T;
const Comparer: IComparer<T>): Boolean; overload; static;
C++
template<typename T> static bool __fastcall Contains(const T *Values, const System::NativeInt Values_High, const T Item)/* overload */;
template<typename T> static bool __fastcall Contains(const T *Values, const System::NativeInt Values_High, const T Item, const System::DelphiInterface<System::Generics::Defaults::IComparer__1<T> > Comparer)/* overload */;
プロパティ
| 種類 | 可視性 | ソース | ユニット | 親 |
|---|---|---|---|---|
| function | public | System.Generics.Collections.pas System.Generics.Collections.hpp |
System.Generics.Collections | TArray |
説明
要素が配列内かどうかをテストします。 Contains は、要素 Value が配列内の場合には True を、そうでなければ False を返します。
要素の検索はリニアなので、これは、n エントリを持つ配列に対する O(n) 操作になります。