I have a byte array that contains list of unicode strings. Each string is terminated with 0x00 0x00. Encoding.Unicode.GetString works, but it returns me one concatenated string. I would like to have it with line breaks.
One possible solution is to replace the 0x00 0x00 sequence with line break and then convert byte array to string with mentioned above function, but I don’t see how can I do it. Any ideas?
Any reason not to convert it to a string first and then use normal string replacement?
EDIT: As noted, you may want to use
Environment.NewLineto get the line separator of the current system. It depends on your context.