procedure TForm1.Button1Click(Sender: TObject);
var temptext:TRichEdit;
Begin
temptext:=TRichEdit.Create(Form1);
temptext.PlainText:=true;
temptext.text:='
{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil MS Sans Serif;}}\viewkind4\uc1\pard\f0\fs16';
temptext.text:=temptext.text+StringReplace(DEINTEXT, '
{', '
\b ', [rfIgnoreCase,rfReplaceAll]);
temptext.text:=StringReplace(temptext.text, '
}', '
\b0', [rfIgnoreCase,rfReplaceAll]);
temptext.text:=StringReplace(temptext.text, chr(13), '
\par', [rfIgnoreCase,rfReplaceAll])+'
}';
DEINTEXT:=temptext.text;
end;