Accueil > Manip’s > Delphi > Mémos > Eliminer les doublons dans un Mémo
Eliminer les doublons dans un Mémo
lundi 29 décembre 2008, par
Créer une Fonction
procedure EliminerDoublons(liste : TStrings);
var
i : integer;
tmp : TStringList;
begin
tmp := TStringList.Create;
try
for i := 0 to liste.Count - 1 do
if (tmp.IndexOf(liste.strings[i]) = -1) then
tmp.Add(liste.strings[i]);
liste.Assign(tmp);
finally
tmp.Free;
end;
end;
Appeler cette fonction pour un Mémo
EliminerDoublons( memo1.Lines ) ;