occurrences property

Map<String, int> occurrences

Counts the number of occurrences of string

Implementation

Map<String, int> get occurrences {
  final String str = removeWhitespace;
  return str.split('').fold(<String, int>{},
      (Map<String, int> map, String char) {
    map[char] = (map[char] ?? 0) + 1;
    return map;
  });
}