code: public static Character detectChar(String string, CharPredicate predicate)
      {
          int size = string.length();
          for (int i = 0; i < size; i++)
          {
              char character = string.charAt(i);
              if (predicate.accept(character))
              {
                  return character;
              }
          }
          return null;
      }
docs: Find the first element that returns true for the specified {@code predicate}.
  
  @since 7.0