You mean something faster than a for-loop? Like a hash table?
I don't know of any hash table in the standard library but there are
some in the class library:
https://www.freepascal.org/docs-html/fcl/contnrs/tfpstringhashtable.html
Dennis,
Look at AnsiMatchStr in strutils.
Dave.
On 2018-10-10 11:11 a.m., Dennis wrote:
> is there a function like
> if IsOneOf('subtext', ['abc','cde','fecg','hig']) then begin
> ...
> end;
>
> is there such a function IsOneOf(TheSubString : String; const
> TheStrings : array of String)
Hello,
I would use IndexStr from StrUtils:
https://www.freepascal.org/docs-html/rtl/strutils/indexstr.html
if IndexStr('subtext', ['abc','cde','fecg','hig']) >= 0 then
Regards
Dennis wrote:
is there a function like
if IsOneOf('subtext', ['abc','cde','fecg','hig']) then begin
...
On Wed, 10 Oct 2018, Dennis wrote:
is there a function like
if IsOneOf('subtext', ['abc','cde','fecg','hig']) then begin
...
end;
is there such a function IsOneOf(TheSubString : String; const TheStrings
: array of String) : Boolean
?
if yes, what is its name and unit?
IndexStr in
is there a function like
if IsOneOf('subtext', ['abc','cde','fecg','hig']) then begin
...
end;
is there such a function IsOneOf(TheSubString : String; const TheStrings
: array of String) : Boolean
?
if yes, what is its name and unit?
Dennis