/** * Find the first element that returns true for the specified {@code predicate}. * * @deprecated since 7.0. Use {@link #detectChar(String, CharPredicate)} instead. */ @Deprecated public static Character detect(String string, CharPredicate predicate) { return StringIterate.detectChar(string, predicate); }
/** * Find the first element that returns true for the specified {@code predicate}. Return the default char if * no value is found. */ public static Character detectCharIfNone(String string, CharPredicate predicate, char resultIfNone) { Character result = StringIterate.detectChar(string, predicate); return result == null ? Character.valueOf(resultIfNone) : result; }
/** * Find the first element that returns true for the specified {@code predicate}. Return the first char of the * default string if no value is found. */ public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone) { Character result = StringIterate.detectChar(string, predicate); return result == null ? Character.valueOf(resultIfNone.charAt(0)) : result; }
/** * Find the first element that returns true for the specified {@code predicate}. * * @deprecated since 7.0. Use {@link #detectChar(String, CharPredicate)} instead. */ @Deprecated public static Character detect(String string, CharPredicate predicate) { return StringIterate.detectChar(string, predicate); }
/** * Find the first element that returns true for the specified {@code predicate}. Return the default char if * no value is found. */ public static Character detectCharIfNone(String string, CharPredicate predicate, char resultIfNone) { Character result = StringIterate.detectChar(string, predicate); return result == null ? Character.valueOf(resultIfNone) : result; }
/** * Find the first element that returns true for the specified {@code predicate}. Return the first char of the * default string if no value is found. */ public static Character detectCharIfNone(String string, CharPredicate predicate, String resultIfNone) { Character result = StringIterate.detectChar(string, predicate); return result == null ? Character.valueOf(resultIfNone.charAt(0)) : result; }