8 lines
195 B
Rust
8 lines
195 B
Rust
|
pub fn titlecase(s: &str) -> String {
|
||
|
let mut c = s.chars();
|
||
|
match c.next() {
|
||
|
None => String::new(),
|
||
|
Some(f) => f.to_uppercase().collect::<String>() + c.as_str(),
|
||
|
}
|
||
|
}
|