sS charIteratorToString_max(CharacterIterator it, int max) { if (it == null) null; new StringBuilder buf; while (max-- > 0 && it.hasNext()) buf.append(it.next()); ret str(buf); } sS charIteratorToString_max(int max, CharacterIterator it) { ret charIteratorToString_max(it, max); }