我想要一个可以接受两个参数(string, number of letters to crop off front)并返回相同字符串的函数,除了字符x之前的字母.
如果我写
let mut example = "stringofletters";
CropLetters(example, 3);
println!("{}", example);
Run Code Online (Sandbox Code Playgroud)
然后输出应该是:
ingofletters
Run Code Online (Sandbox Code Playgroud)
有什么方法可以做到这一点吗?