fn string_slice(arg: &str) { println!("{}", arg); } fn string(arg: String) { println!("{}", arg); } fn main() { //string("blue"); string_slice("blue"); string("red".to_string()); //string_slice("red".to_string()); string(String::from("hi")); //string_slice(String::from("hi")); string("rust is fun!".to_owned()); //string_slice("rust is fun!".to_owned()); string("nice weather".into()); string_slice("nice weather".into()); string(format!("Interpolation {}", "Station")); //string_slice(format!("Interpolation {}", "Station")); //string(&String::from("abc")[0..1]); string_slice(&String::from("abc")[0..1]); //string(" hello there ".trim()); string_slice(" hello there ".trim()); string("Happy Monday!".to_string().replace("Mon", "Tues")); //string_slice("Happy Monday!".to_string().replace("Mon", "Tues")); string("mY sHiFt KeY iS sTiCkY".to_lowercase()); //string_slice("mY sHiFt KeY iS sTiCkY".to_lowercase()); }