C# – Print out List as a string value

bytebytearrayc#-2.0c++list

I googled and found the statement to convert byte[] value to string value as this,

string myString =System.Text.Encoding.UTF8.GetString(myByteArray);

But I defined the variable to List<byte>. How can I convert the List<byte> bMsg to byte[] bMsgArrary?

List<byte> bMsg   to byte[]  bMsgArray ?;

Or there is other method to convert List<byte> value to string value. Appreciated for you help.

Best Solution

Use ToArray() on the list in order to get myByteArray and off you go.