System.Generics.Collections.TList.Contains

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Contains(const Value: T): Boolean; inline;

C++

bool __fastcall Contains(const T Value);

Properties

Type Visibility Source Unit Parent
function public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TList

Description

Test whether an element is in a list.

Contains returns True if the element Value is in the list and False otherwise. This method only indicates whether the element is in the list or not; use IndexOf to get the index of an element in a list.

Since the search for the element is linear, it is an O(n) operation for a list with n entries.

See Also

Code Examples