1分钟内可阅读完
内容来源 · Tour of Rust / Rust 语言之旅
原文链接: https://tourofrust.com/69_zh-cn.html
concat 和 join 可以以简洁而有效的方式构建字符串。
concat
join
1 2 3 4 5 6
fn main() { let helloworld = ["你好", " ", "世界", "!"].concat(); let abc = ["a", "b", "c"].join(","); println!("{}", helloworld); println!("{}",abc); }