/** * Count the number of instances of character within a string. * * @param string String to look for substring in. * @param c Character to look for. * @return Count of substrings in string. */ public static int count(final String string, final char c) { return count(string, String.valueOf(c)); }
int count = count(string, delim) + 1; if (limit > 0 && count > limit)