Title: Replace Strings in a RichEdit
Question: As I can replace a chain in a RichEdit?
Answer:
//----------------------------------
// Busqueda = String to search.
// cadena = replace to this string.
//----------------------------------
procedure reemplazar(busqueda, cadena: string);
var n : integer;
begin
n :=RichEdit1.FindText(busqueda,0,Length(RichEdit1.Text),[stMatchCase]);
if n -1 then
begin
RichEdit1.SelStart := n;
Richedit1.SelLength := Length(busqueda);
RichEdit1.SetSelTextBuf(PAnsiChar(cadena));
end;
end;