<p>I want do something like this:</p>

<pre><code>Result = 'MyString' in [string1, string2, string3, string4];
</code></pre>

<p>This can't be used with strings and I don't want to do something like this:</p>

<pre><code>Result = (('MyString' = string1) or ('MyString' = string2));
</code></pre>

<p>Also I think that creating a StringList to do just this is too complex.</p>

<p>Is there some other way to achieve this?</p>

<p>Thanks.</p>

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.