Re: any free pascal standard function to compare a, string against an array of string?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: any free pascal standard function to compare a, string against an array of string?

Ingemar Ragnemalm

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
https://www.freepascal.org/docs-html/fcl/contnrs/tfphashlist.html

I have not used these myself but they may suit your problem.

Or you can just write your own hash table function. It is not that hard.

/Ingemar

Den 2018-10-10 kl. 17:31, skrev [hidden email]:
> 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?

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal