/** * Count the number of occurrences of the specified int code point. * * @since 7.0 */ public static int occurrencesOfCodePoint(String string, final int value) { return StringIterate.countCodePoint(string, new CodePointPredicate() { public boolean accept(int codePoint) { return value == codePoint; } }); }
/** * Count the number of elements that return true for the specified {@code predicate}. * * @deprecated since 7.0. Use {@link #countCodePoint(String, CodePointPredicate)} instead. */ @Deprecated public static int count(String string, CodePointPredicate predicate) { return StringIterate.countCodePoint(string, predicate); }
/** * Count the number of occurrences of the specified int code point. * * @since 7.0 */ public static int occurrencesOfCodePoint(String string, final int value) { return StringIterate.countCodePoint(string, new CodePointPredicate() { public boolean accept(int codePoint) { return value == codePoint; } }); }
/** * Count the number of elements that return true for the specified {@code predicate}. * * @deprecated since 7.0. Use {@link #countCodePoint(String, CodePointPredicate)} instead. */ @Deprecated public static int count(String string, CodePointPredicate predicate) { return StringIterate.countCodePoint(string, predicate); }