Tuesday, October 16, 2018

Turn a list of strings into a bytes array in C# with String.Join in the mix!

I found the following at StackOverflow here.

string fullString = String.Join(String.Empty, list.ToArray());
byte[] byteArray = Encoding.UTF8.GetBytes(fullString);

No comments:

Post a Comment