mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-03-16 04:55:01 +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 {
|
fn trim_me(input: &str) -> &str {
|
||||||
// TODO: Remove whitespace from both ends of a string.
|
// TODO: Remove whitespace from both ends of a string.
|
||||||
|
input.trim().to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compose_me(input: &str) -> String {
|
fn compose_me(input: &str) -> String {
|
||||||
// TODO: Add " world!" to the string! There are multiple ways to do this.
|
// 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 {
|
fn replace_me(input: &str) -> String {
|
||||||
// TODO: Replace "cars" in the string with "balloons".
|
// TODO: Replace "cars" in the string with "balloons".
|
||||||
|
input.replace("world", "rustaceans")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
Loading…
Reference in a new issue