All,
I have a question about converting byte arrays with nulls to C# string.
Here is an example of my byte array that I would like to convert to string.
I expect to get a string with value SHKV
[0]: 83
[1]: 0
[2]: 72
[3]: 0
[4]: 75
[5]: 0
[6]: 86
[7]: 0
How can I do it in C# ?
Thanks,
MK
You really need to know the original encoding in order to convert it successfully.
I suspect that in this case the encoding is probably UTF-16, which you can convert as follows: