fn capit(s: &str) -> String {
let mut c = s.chars();
match c.next(){
Some(f) => f.to_uppercase().collect::<String>() + c.as_str(),
None => String::new(),
}
}
Rust笔记_首字母变大写的方法
于 2022-11-22 15:06:56 首次发布