I use this function in Delphi 10.3.3:
function StrTrimCharsLeft(const S: string; const Chars: array of Char): string;
var
I, L: SizeInt;
begin
I := 1;
L := Length(S);
while (I <= L) and ArrayContainsChar(Chars, S[I]) do
Inc(I);
Result := Copy(S, I, L - I + 1);
end;
When I use the function in this way I get an error:
[dcc32 Error]: E2250 There is no overloaded version of 'StrTrimCharsLeft' that can be called with these arguments
const
BomChars = ['ï', '»', '¿'];
...
s := JclStrings.StrTrimCharsLeft(s, BomChars);
But when I use it in this way, all works well without an error:
s := JclStrings.StrTrimCharsLeft(s, ['ï', '»', '¿']);
So how can I define and use an array of Char as a constant?