Function StrList_Merge(StrListA,StrListB:String):String; //将两个Strlist合并,求并集
var SListA,SListB,SListC:TStringList;
i:Integer;
begin
Result := '';
Try
SListA := TStringList.Create;
SListB := TStringList.Create;
SListC := TStringList.Create;
SListA.CommaText := StrListA;

SListB.CommaText := StrListB;
SListC.Assign(SListA);
for i:=0 to SListB.Count-1 do begin
if SListC.IndexOf(SListB[i])<0 then SListC.Add(SListB[i]);
end;
Result := SListC.CommaText;
Finally
FreeAndNil(SListA);

FreeAndNil(SListB);

FreeAndNil(SListC);
end;

end;

相关文章:

  • 2022-01-03
  • 2022-03-03
  • 2022-02-04
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2021-09-20
相关资源
相似解决方案