如 : 原串在 Edit1.Text中 修改后的串在 Edit2.Text中 var astr,bstr,cstr:string;begin astr:=Edit1.Text; bstr:=''''+''''; cstr:=stringreplace(astr,'''',bstr,[rfReplaceAll]); edit2.text:=cstr;end; 这样就可以避免从SQL数据库中读取的记录有单撇号后在写入数据库时出错