procedure ProcessSameString(DourStr,DestStr:TStrings);
var
s:String;
i:integer;
begin
if (DourStr=nil) or (DestStr=nil) then Exit;
for i:=0 to DourStr.Count-1 do
begin
s:=DourStr.Strings;
if DestStr.IndexOf(s) =-1 then
DestStr.add(s);
end;
end;
//DestStr就是你想要的字符串列表.
var strList:TStringList;
..........................
strList := TStringList.create;
for i := 0 to length(a)-1 do begin
if strList.indexof(a)<0 then begin
strList.add(a)
end;
end;
strList.sort;
setlength(a,strList.count)
for i := 0 to strList.count -1 do begin
a := strList
end;
const
a: Array[0..6] of String = ('aaa','aaa','bbb','ccc','aaa','bbb','bbb');
var
i: Integer;
b: array of String;
sl: TStringList;
begin
sl := TStringList.Create;
for i := Low(a) to High(a) do
begin
if sl.IndexOf(a) <> -1 then continue
else sl.Add(a);
end;
SetLength(b, sl.Count);
for i := 0 to sl.Count - 1 do
b := sl.Strings;
end;