count method
Count occurrences of value between start (inclusive) and end (exclusive).
Implementation
int count(String value, [int start = 0, int? end]) {
final sub = (end == null) ? substring(start) : substring(start, end);
return value.allMatches(sub).length;
}