referencing variable before slicing it

前端 未结 0 528
旧巷少年郎
旧巷少年郎 2020-12-09 15:19

I currently learning rust comming from JS.

My problem is following:

fn main() {
    let name = String::from("Tom");
    let sliced = name[..2         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题