Quiz · Lifetimes · lesson 5 of 6
Quiz — two inputs, one output
What does the program print?
fn tail(n: usize, s: &str) -> &str {
&s[n..]
}
fn main() {
let s = String::from("hello");
println!("{}", tail(2, &s));
}What does the program print?
fn tail(n: usize, s: &str) -> &str {
&s[n..]
}
fn main() {
let s = String::from("hello");
println!("{}", tail(2, &s));
}