我想把字符串中所有的'换成两个'
比如abc'c换为abc''c,或者abc''c换为abc''''c
请指点

解决方案 »

  1.   

    function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;
      

  2.   

    楼上的,不对吧。
    function QuotedStr(const S: string): string;DescriptionUse QuotedStr to convert the string S to a quoted string. A single quote character (') is inserted at the beginning and end of S, and each single quote character in the string is repeated.
      

  3.   

    use
      StrUtils;procedure TForm1.Button1Click(Sender: TObject);
    const
     s = 'abc''c';
    begin
      ShowMessage(AnsiReplaceText(s, '''', ''''''));
      ShowMessage(StringReplace(s, '''', '''''', [rfReplaceAll]));
    end;
      

  4.   

    AnsiReplaceText(const S,','')--------------------------------挑衅??!!呵呵!