[fpc-pascal] any free pascal standard function to compare a string against an array of string?

OBones obones at free.fr
Wed Oct 10 17:17:04 CEST 2018


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
> ...
> end;
>
> is there such a function IsOneOf(TheSubString : String; const 
> TheStrings : array of String) : Boolean
> ?
> if yes, what is its name and unit?
>
> Dennis
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list