Board index » cppbuilder » Simple AnsiString Question

Simple AnsiString Question

Quote
Eric Hobbs <EricTHo...@Netscape.Net> wrote:
>Hello All, I can't seem to find a replace function for
>AnsiString, ie

>AnsiString AS_TEST = "This&is&A&String"; //SAMPLE STRING
>AS_TEST.replace("&","");

  AnsiString MyString = "This&is&A&String";
  MyString = StringReplace(MyString, "&", "", TReplaceFlags() << rfReplaceAll);
 

Re:Simple AnsiString Question


Quote
"Eric Hobbs" <EricTHo...@Netscape.Net> wrote in message

news:3E87ED01.5060405@Netscape.Net...

Quote
> Hello All, I can't seem to find a replace function for AnsiString

AnsiString doesn't have one.  There is, however, a separate StringReplace()
function which takes AnsiString as parameters:

    AnsiString Str = "This&is&A&String";
    Str = StringReplace(Str, "&", "", TReplaceFlags() << rfReplaceAll);

Gambit

Other Threads