string - 如何在 no_std 环境中连接字符串?
问题描述
我正在尝试&str
在不使用 std 的情况下连接两个字符串 () 或在 Rust 中转换字符串中的字节数组。我看到了,core::str::from_utf8
但这不是我要找的。
我正在寻找类似的东西
let b: [u8; 2] = [97, 98];
let result: &str = core::str::array_to_string(b); // "ab"
或者
let a: &str = "Hello ";
let b: &str = "world !";
let result: &str = core::str::concatenate(a, b);
解决方案
推荐阅读
- python - 即时从 python 中的 subprocess.run() 获取输出
- google-maps - 在 Google Maps Places Autocomplete API 上限制特定城市的搜索
- java - 如何修复“未连接适配器;跳过布局”
- python - 如何在 Python 中将一个数组中的多列堆叠在一起?
- active-directory - terraform 无法创建 AD VM,因为缺少公共 ip
- javascript - 从邮件列表中检索名字和第二名
- android - 在片段上使用谷歌地图时,它不起作用,但在活动中使用相同的地图,为什么?
- mongodb-atlas - 为什么我有这个错误?(无法解码消息长度:.....)
- php - PHP:读取 PDF 并获取特定单词(标签)的位置
- installshield - 如何通过 InstallShield patchDesign 视图确定补丁文件名