text-utils 0.4.1

Text utils for unescaping and align
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod emoji;
mod html;
mod table_align;
mod text_align;
mod text_escape;

pub use self::{emoji::*, html::*, table_align::*, text_align::*, text_escape::*};

/// capitalize first letter
pub fn capitalize_first_letter(text: impl AsRef<str>) -> String {
    let text = text.as_ref();
    let mut c = text.chars();
    match c.next() {
        None => String::new(),
        Some(f) => f.to_uppercase().collect::<String>() + c.as_str(),
    }
}