Witam wszystkich
Czy da się to zapisać w inny bardziej przyjrzysty/krótszy sposób ??
W każdej opcji jedyna różnica jaka występuje to warunek "if".
case SearchType of
opcja1:
for i := 0 to Count - 1 do
if Text[i] = FindText then begin
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := Text[i];
end;
opcja2:
for i := 0 to Count - 1 do
if LowerCase(Text[i]) = LowerCase(FindText) then begin
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := Text[i];
end;
opcja3:
for i := 0 to Count - 1 do
if LowerCase(Text[i]) <> LowerCase(FindText) then begin
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := Text[i];
end;
end;
Pzdr