|
|
A simple example of found and not found elements |
program Project1;
{$APPTYPE CONSOLE}
uses
System.Collections;
var
List : System.Collections.ArrayList;
begin // Create our array list object
List := ArrayList.Create;
// Fill it
List.Add('ABC');
List.Add('DEF');
List.Add('GHI');
List.Add('JKL');
List.Add('MNO');
// Try to find 'GHI'
if List.Contains('GHI')
then Console.WriteLine('''GHI'' found')
else Console.WriteLine('''GHI'' not found');
// Try to find 'ghi'
if List.Contains('ghi')
then Console.WriteLine('''ghi'' found')
else Console.WriteLine('''ghi'' not found');
Console.Readline;
end.
|
'GHI' found
'ghi' not found
|
|
|
|