我有一个字节数组,我想将其返回为std::string::String. 我发现的其他答案和文档是将 Vectors 转换为字符串。
我如何将字节数组转换&[u8]为 a String?
它正在与std::str::from_utf8:
std::str::from_utf8(byte_array).unwrap().to_string();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5141 次 |
| 最近记录: |