Skip to main content

sort_ascii_counts

Function sort_ascii_counts 

Source
pub fn sort_ascii_counts(input: &str, ignore_case: bool) -> Vec<(char, usize)>
Expand description

统计字符串中各 ASCII 字符的出现频率,并按降序排序。

§返回值

返回一个向量,元素为 (字符, 出现次数),按次数降序排列,次数相同时按字符升序排列。