Essentially you do not have much to do, you have to check item by item. Depending on what you want there are other data structures that can minimize the search time.
On the other hand, maybe you just mount a loop to scan the entire array with a for in
:
var
Tabela : Array of String;
Str : String;
begin
Tabela[0] := 'Valor';
Tabela[1] := 'Value';
for Str in Tabela do
if Str = 'Valor' then
// do wathever;
end;
I just discovered that it is very difficult to find official Delphi documentation. But I found some things that talk about for in
.
I found another way with for
normal in response in the OS . You are scanning the entire array in the same way but manually moving from index to index:
function StringInArray(const Value: string; Strings: array of string): Boolean;
var I: Integer;
begin
Result := True;
for I := Low(Strings) to High(Strings) do
if Strings[i] = Value then Exit;
Result := False;
end;
I placed GitHub for future reference.