marpis
2009-05-27 09:03:59
It cheks if some of the strings in substrarr is found on str, and returns the position. Example:
PosExx(['ones', 'hicken'], GetUpText)
It's not case-sensitive.
I have found this function very useful in many ways
Edited to return index too
PosExx(['ones', 'hicken'], GetUpText)
It's not case-sensitive.
I have found this function very useful in many ways
function PosExx(substrarr: TStringArray; str: string;var index: integer): integer;
var
i: integer;
begin
for i:= 0 to High(substrarr) do
begin
result:= pos(lowercase(substrarr[i]), lowercase(str));
if (result > 0) then
begin
index := i;
exit;
end;
end;
end;
Edited to return index too