Cannot remove `Null Characters` from a string
I asked a similar question couple months ago. Thanks to Rob Kennedy I could load my whole text into a Richedit BUT I couldn't remove Null chars . I could load my text because I used Stream . Now in this code: var strm : TMemorystream; str : UTF8string; ss : TStringstream; begin strm := tmemorystream.Create; try strm.LoadFromFile('C:\Text.txt'); setstring(str,PAnsichar(strm.Memory),strm.Size); str := StringReplace(str, #0, '', [rfReplaceAll]); //This line doesn't work at all ss := tstringstream.Create(str); Richedit1.Lines.LoadFromStream(ss); finally strm.Free; ss.Free; end; end; I converted