Exercise 40

This commit is contained in:
akshitgautam42 2023-11-13 18:13:18 +05:30
parent 1b393bbe11
commit eb0c4f8aa4

View File

@ -3,21 +3,21 @@
// Execute `rustlings hint strings3` or use the `hint` watch subcommand for a
// hint.
// I AM NOT DONE
fn trim_me(input: &str) -> String {
// 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's multiple ways to do this!
???
input.to_string()+" world!"
}
fn replace_me(input: &str) -> String {
// TODO: Replace "cars" in the string with "balloons"!
???
input.replace("cars", "balloons")
}
#[cfg(test)]