//RichEdit.Text := 'abcdefghijklmnopqrstuvwxyz';
procedure TForm1.Button1Click(Sender: TObject);
var
s,s1: string;
i: Integer;
begin
s := Edit1.Text;
s1 := RichEdit1.Text;
i := RichEdit1.FindText(s,0,Length(s1),[stMatchCase]);
if i <> -1 then
ShowMessage(s)
else
ShowMessage('Not Find');
end
//测试通过, 即使换行也可以正确搜索!