mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 07:46:29 +00:00
Updated TODO in strings3.rs
This commit is contained in:
parent
26cf4989a2
commit
cf62575680
1 changed files with 4 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue