Код:
procedure TForm2.Button1Click(Sender: TObject);
var
tmpList:TStringList;
i:integer;
begin
tmpList:=TStringList.Create;
tmpList.Delimiter:=' ';
tmpList.Sorted:=true;
tmpList.Duplicates:=dupIgnore;
tmpList.DelimitedText:=Memo1.Lines.Text;
Memo1.Clear;
for i:=0 to tmpList.Count - 2 do
Memo1.Lines.Add(tmpList[tmpList.Count-1]+tmpList.Delimiter+tmpList[i]);
tmpList.Free;
end;
З.Ы. свойство Lines в TMemo также имеет тип TStrings