我想不分大小写的替换一个字串
如:STRINGPLACE(stTemp,'xxx','');
我相当 xxx 为大写的时候,也可以替换掉,如何做?

解决方案 »

  1.   

    哦?有STRINGPLACE吗?我见过STRINGREPLACE,函数原型是:
    function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;
    只要把最后一个参数TReplaceFlags写成rfIgnoreCase就OK了,详细请看delphi的帮助,很简单的
      

  2.   

    sorry,我写错了,我改成了rfIgnoreCase,可是不行,为什么?
      

  3.   

    memo1.Lines.Text:=stringreplace(memo1.Lines.Text,'<font color=red>','',[rfIgnoreCase]);
    当值为<FONT color=red>就替换不掉了
      

  4.   

    Edit1.Text := StringReplace(Edit1.Text, Edit2.Text, Edit3.Text, [rfReplaceAll, rfIgnoreCase])没有问题啊。
      

  5.   

    Memo1.Lines.Text := StringReplace(Memo1.Lines.Text, '<FONT color=red>', '', [rfReplaceAll, rfIgnoreCase])也没有你说的问题。