16,748
社区成员
发帖
与我相关
我的任务
分享
var
tmpList,sumList : TStringList;
I,tmpInd : Integer;
begin
tmpList := TStringList.Create;
sumList := TStringList.Create;
tmpList.Clear;
tmpList.CommaText := '01,03,05,01,06,08,06,12';
for I := 0 to tmpList.Count - 1 do begin
tmpInd := sumList.IndexOfName(tmpList[I]);
if tmpInd = -1 then begin
sumList.Add(tmpList[I] + '=1');
end else begin
sumList.Values[tmpList[I]] := sumList.Values[tmpList[I]] + 1;
end;
end;