StringUtils { public static String cut(String s, int length, char delim, int index) { return cut(s, length, delim, index, Trim.NONE); }  static String trim(String s, Trim trim); static String requireNonEmpty(String s); static String requireNonBlank(String s); static Optional<String> optionalOf(String s); static String cut(String s, int length, char delim, int index); static String cut(String s, int length, char delim, int index, Trim trim); static String[] split(String s, char delim); static String[] split(String s, int length, char delim); static String[] split(String s, int length, char delim, Trim trim); static String join(String[] ss, int off, int len, char delim); static String trimDS(String s); static String trimAndNullifyEmpty(String s); static final String[] EMPTY_STRINGS; }
@Test void cut() { assertEquals("", StringUtils.cut(JOINED, 0, DELIM, 0)); for (int i = 0; i < ARRAY.length; i++) { assertEquals(ARRAY[i], StringUtils.cut(JOINED, JOINED.length(), DELIM, i)); } assertEquals("", StringUtils.cut(JOINED, JOINED.length(), DELIM, ARRAY.length)); }