Count how many times a substring occurs
int countOccurrences(String substring) => split(substring).length - 1;