在 Rust 中是否有将 char
转换为 String
的简洁方法,除了:
let mut s = String::new();
s.push('c');
最佳答案
您使用 to_string()
方法:
'c'.to_string()
关于string - 如何将 char 转换为 String?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28003483/