我试图在 Rust 中使用空格和,. 我试着做
let v: Vec<&str> = "Mary had a little lamb".split_whitespace().collect();
let c: Vec<&str> = v.split(',').collect();
Run Code Online (Sandbox Code Playgroud)
结果:
let v: Vec<&str> = "Mary had a little lamb".split_whitespace().collect();
let c: Vec<&str> = v.split(',').collect();
Run Code Online (Sandbox Code Playgroud) rust ×1