diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-19 17:59:40 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-19 17:59:40 -0500 |
| commit | 7fbdb1bf864c688d247ea9314627064627643fc6 (patch) | |
| tree | a1ebc08fc4b3a07751d11b08f8f1ef95da916a9a /rustlings/exercises/09_strings/strings3.rs | |
| parent | 0675822a60f0873fe1644f7524e7d4c8936e4047 (diff) | |
| download | demos-7fbdb1bf864c688d247ea9314627064627643fc6.tar.gz demos-7fbdb1bf864c688d247ea9314627064627643fc6.zip | |
Diffstat (limited to 'rustlings/exercises/09_strings/strings3.rs')
| -rw-r--r-- | rustlings/exercises/09_strings/strings3.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rustlings/exercises/09_strings/strings3.rs b/rustlings/exercises/09_strings/strings3.rs index f5e45b0..3543ad5 100644 --- a/rustlings/exercises/09_strings/strings3.rs +++ b/rustlings/exercises/09_strings/strings3.rs @@ -1,13 +1,13 @@ fn trim_me(input: &str) -> &str { - // TODO: Remove whitespace from both ends of a string. + input.trim() } fn compose_me(input: &str) -> String { - // TODO: Add " world!" to the string! There are multiple ways to do this. + String::from(input) + " world!" } fn replace_me(input: &str) -> String { - // TODO: Replace "cars" in the string with "balloons". + String::from(input).replace("cars", "balloons") } fn main() { |
