将字节数组转换为字符串

305 305
C#
sam
sam 2024-05-11 15:44:27

代码

byte[] bytes = new byte[] { 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100 };
string str = Encoding.UTF8.GetString(bytes);
Console.WriteLine("字符串:");
Console.WriteLine(str);


回帖
  • 消灭零回复