From 0a83ac648b22f92f0d62d7d937163deb594d5009 Mon Sep 17 00:00:00 2001 From: eslopfer Date: Mon, 7 Nov 2022 14:55:29 +0000 Subject: [PATCH] docs(modify_letter): add description of the subject --- subjects/modify_letter/README.md | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 subjects/modify_letter/README.md diff --git a/subjects/modify_letter/README.md b/subjects/modify_letter/README.md new file mode 100644 index 000000000..0adbfaca0 --- /dev/null +++ b/subjects/modify_letter/README.md @@ -0,0 +1,46 @@ +## modify_letter + +### Instructions + +Create a **function** `remove_letter_sensitive` that returns a string without the letter specified as argument + +Create a **function** `remove_letter_insensitive` that returns a string without the letter specified as argument (ignoring case) + +Create a **function** `swap_letter_case` that returns a string swapping the case for the chosen letter. + +### Expected Functions + +```rust +pub fn remove_letter_sensitive(s: &str, letter: char) -> String { +} + +pub fn remove_letter_insensitive(s: &str, letter: char) -> String { +} + +pub fn swap_letter_case(s: &str, letter: char) -> String { +} +``` + +### Usage + +Here is a program to test your functions. + +```rust +use modify_letter::*modify_letter*; + +fn main() { + println!("{}", remove_letter_sensitive("Joje jis mijssjing", "j")); + println!("{}", remove_letter_insensitive("jaillA ais swiaAmmingA", "A")); + println!("{}", swap_letter_case("hEllo therE", "e")); +} +``` + +And its output + +```console +$ cargo run +Joe is missing +Jill is swimming +Hello thERe +$ +```