[fpc-pascal] Byte array manipulation

theo xpde at theo.ch
Sun Aug 16 20:49:33 CEST 2009


AnsiString does not have problems with #0.

Test:

var aStr:AnsiString;
begin
aStr:='test-test-test';
aStr:=StringReplace(aStr,'-',#0,[rfReplaceAll]);
//if you ouput now, you'll only see 'test'...
aStr:=StringReplace(aStr,#0,'-',[rfReplaceAll]);
//...but the text is still in the String;
Edit1.text:=aStr;
end;




More information about the fpc-pascal mailing list