I have written a function to prompt for input and return the result. In this version the returned string includes a trailing newline from the user. I would like to return th
fn main() {
let mut s = "hello\n".to_string();
s.pop();
assert_eq!("hello", &s);
let mut s = "hello\n".to_string();
let len = s.len();
s.truncate(len - 1);
assert_eq!("hello", &s);
}