diff --git a/exercises/09_strings/strings3.rs b/exercises/09_strings/strings3.rs index 39fce18c..6bd49bdb 100644 --- a/exercises/09_strings/strings3.rs +++ b/exercises/09_strings/strings3.rs @@ -1,13 +1,17 @@ fn trim_me(input: &str) -> &str { // TODO: Remove whitespace from both ends of a string. + input.trim().to_string(); } fn compose_me(input: &str) -> String { // TODO: Add " world!" to the string! There are multiple ways to do this. + let result = input.to_string() + " world!"; + result } fn replace_me(input: &str) -> String { // TODO: Replace "cars" in the string with "balloons". + input.replace("world", "rustaceans") } fn main() {