string from byte C# code example
Example 1: string from byte array c#
var str = System.Text.Encoding.Default.GetString(result);
Example 2: c# string to byte[]
using System.Text;
public static byte[] encode(string stringToEncode)
{
UTF8Encoding utf8 = new UtF8Encoding();
byte[] bytename = new byte[1024];
bytename = utf8.GetBytes(stringToEncode);
return bytename;
}