I’m trying to run AnsiStrings.StringReplace on a RawByteString holding a blob of data, some of which needs to be replaced. It would work, except that inside StringReplace it converts my string to a PAnsiChar, and so the search ends up bailing out as soon as it hits the first #0 byte inside the blob.
I’m looking for a routine that works just like StringReplace, but is safe to use on blobs that may contain null bytes. Does anyone know of one?
I’d guess the “Offending” function in StringReplace is AnsiPos->AnsiStrPos
So… I guess short of an already working solution, I’d copy/paste the StringReplace code and change AnsiPos for something else. (i.e. AnsiStrings.PosEx)