Updated TODO in strings3.rs

This commit is contained in:
GURUSUJAN REDDY 2024-12-26 01:41:14 +05:30 committed by GitHub
parent 26cf4989a2
commit cf62575680
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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() {