Function StrList_Del(StrList,DelStrList:String):String; //将DelStrList中包含的元素,从Strlist中删除,如果在Strlist中存在的话
Var _StrList,_DelStrList,_RtnStrList:TStringList;
I:integer;
begin
_StrList := nil; _DelStrList := nil; _RtnStrList := nil;
Try
_StrList := TStringlist.create;
_DelStrList := TStringlist.create;
_RtnStrList := TStringlist.create;
_StrList.CommaText := StrList;
_DelStrList.CommaText := DelStrList;
for i:=0 to _StrList.count-1 do begin
if _DelStrList.IndexOf(_StrList[i])<0 then _RtnStrList.add(_StrList[i]);
end;
result := _RtnStrList.commatext;
Finally
if Assigned(_StrList) then FreeAndNil(_StrList);
if Assigned(_DelStrList) then FreeAndNil(_DelStrList);
if Assigned(_RtnStrList) then FreeAndNil(_RtnStrList);
End;
end;