I want do something like this:
Result = \'MyString\' in [string1, string2, string3, string4];
This can\'t be used with strings and I don\'t wan
The code by Burkhard works, but iterates needlessly over the list even if a match is found.
Better approach:
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;