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
Here is a function that does the job:
function StringInArray(Value: string; Strings: array of string): Boolean;
var I: Integer;
begin
Result := False;
for I := Low(Strings) to High(Strings) do
Result := Result or (Value = Strings[I]);
end;
In fact, you do compare MyString with each string in Strings. As soon as you find one matching you can exit the for loop.