int findCount(String input, String pattern) { var splitted = input.split(pattern); return splitted.length - 1; }