Readers { public static String until(StringReader reader, char delimiter) { var start = reader.getCursor(); while (reader.canRead() && reader.peek() != delimiter) { reader.skip(); } return reader.getString().substring(start, reader.getCursor()); }  static String until(StringReader reader, char delimiter); static String until(StringReader reader, char... delimiters); static String until(StringReader reader, Predicate<Character> end); static final Pattern COMMA; }
@Test void until_char() { assertEquals("a", Readers.until(reader, 'b')); }
@Test void until_chars() { assertEquals("ab", Readers.until(reader, 'c', 'd')); }
@Test void until_predicate() { assertEquals("abc", Readers.until(reader, val -> val == 'd')); }