Since .NET does not use the C null style to end the string, how can I save the selected string, but change its length using unsafe code?
As I understand it, using a 20-byte header for each line, presumably this is where the length of the string is stored, is there anyway the ability to directly change this length? Therefore, .NET will save the string in memory, but when I call .Length , it will return .Length me.
if possible, it would also be interesting to hear all the crazy possible side effects of this
UPDATE
I am trying to accomplish this without using reflection.
source share