5,388
社区成员
发帖
与我相关
我的任务
分享
var
TstringTmp01,TstringTmp02:THashedStringList;//
intTmp01,intTmp02,intIndex:integer;//计数器
StrSource,StrCheck:string; //源字符和对比字符
int_Temp:integer;
begin
TstringTmp01:=THashedStringList.Create;
TstringTmp02:=THashedStringList.Create;
TstringTmp01.LoadFromFile('20080227123152.txt');
label1.Caption:=inttostr(TstringTmp01.Count);
TstringTmp01.Sort;
// TstringTmp01.Sorted:=true;
int_Temp:=0;
for intTMp01 := 0 to TstringTmp01.Count-1 do begin
strSource:=TstringTmp01[intTmp01];
if (length(strSource)>0) then begin
while (TstringTmp01.Find(strSource,intTmp02))do
TstringTmp01[intTmp02]:='';
if not TstringTmp02.Find(strSource,int_Temp) then TstringTmp02.Add(strSource);
end;
end;
for intTmp02 := 0 to TstringTmp02.Count - 1 do
memo2.Lines.Add(TstringTmp02[intTmp02]);
TstringTmp01.Free;
TstringTmp02.Free;