luludada-s-library 0.2.0

A small utility library for demonstration
Documentation
1
2
3
4
5
6
7
8
/// 字符串相关的工具函数
pub fn capitalize(s: &str) -> String {
    let mut c = s.chars();
    match c.next() {
        None => String::new(),
        Some(f) => f.to_uppercase().collect::<String>() + c.as_str(),
    }
}