I know, I can write
if C in ['#', ';'] then ...
if C
is an AnsiChar
.
But this
function CheckValid(C: Char; const Invalid: array of Char; OtherParams: TMyParams): Boolean;
begin
Result := C in Invalid; // <-- Error because Invalid is an array not a set
//maybe other tests...
//Result := Result and OtherTestsOn(OtherParams);
end;
yields E2015: Operator not applicable to this operand type
.
Is there an easy way to check if a character is contained in an array of characters (other than iterate through the array)?