ambition/src/helpers.rs

8 lines
195 B
Rust
Raw Normal View History

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(),
}
}