mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
627 B
37 lines
627 B
4 years ago
|
## lastup
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Complete the `lastup` function that takes a string and puts the last letter of each word in uppercase and the rest in lowercase.
|
||
|
|
||
|
### Expected Functions
|
||
|
|
||
|
```rust
|
||
|
pub fn lastup(input: &str) -> String {
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### Usage
|
||
|
|
||
|
Here is a program to test your function.
|
||
|
|
||
|
```rust
|
||
|
use lastup::lastup;
|
||
|
|
||
|
fn main() {
|
||
|
println!("{}", lastup("joe is missing"));
|
||
|
println!("{}", lastup("jill is leaving A"));
|
||
|
println!("{}",lastup("heLLo THere!"));
|
||
|
}
|
||
|
```
|
||
|
|
||
|
And its output
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/[[ROOT]]/test$ cargo run
|
||
|
joE iS missinG
|
||
|
jilL iS leavinG A
|
||
|
hellO therE!
|
||
|
student@ubuntu:~/[[ROOT]]/test$
|
||
|
```
|