progress(enums + strings): ___

This commit is contained in:
2026-07-26 01:22:48 +02:00
parent 3caf0b31ec
commit f0f6a72101
7 changed files with 33 additions and 11 deletions
+5
View File
@@ -1,13 +1,18 @@
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.
let world = " world!";
let s: String = input.to_owned() + world;
s
}
fn replace_me(input: &str) -> String {
// TODO: Replace "cars" in the string with "balloons".
input.replace("cars", "balloons")
}
fn main() {