text_utils/utils/mod.rs
1mod color;
2mod emoji;
3mod html;
4mod table_align;
5mod text_align;
6mod text_escape;
7mod urls;
8
9pub use self::{color::*, emoji::*, html::*, table_align::*, text_align::*, text_escape::*, urls::*};
10
11/// capitalize first letter
12pub fn capitalize_first_letter(text: impl AsRef<str>) -> String {
13 let text = text.as_ref();
14 let mut c = text.chars();
15 match c.next() {
16 None => String::new(),
17 Some(f) => f.to_uppercase().collect::<String>() + c.as_str(),
18 }
19}