@Test void testSplit() { String byteRangeSet = "500-"; String[] byteRangeSets = StringUtils.split(byteRangeSet, ','); System.out.println(Arrays.toString(byteRangeSets)); assertEquals(byteRangeSets.length, 1); byteRangeSet = "500-,"; byteRangeSets = StringUtils.split(byteRangeSet, ','); System.out.println(Arrays.toString(byteRangeSets)); assertEquals(byteRangeSets.length, 1); byteRangeSet = ",500-,"; byteRangeSets = StringUtils.split(byteRangeSet, ','); System.out.println(Arrays.toString(byteRangeSets)); assertEquals(byteRangeSets.length, 1); byteRangeSet = ",500-,"; byteRangeSets = StringUtils.split(byteRangeSet, ","); System.out.println(Arrays.toString(byteRangeSets)); assertEquals(byteRangeSets.length, 1); byteRangeSet = ",500-"; byteRangeSets = StringUtils.split(byteRangeSet, ','); System.out.println(Arrays.toString(byteRangeSets)); assertEquals(byteRangeSets.length, 1); byteRangeSet = "500-700,601-999,"; byteRangeSets = StringUtils.split(byteRangeSet, ','); assertEquals(byteRangeSets.length, 2); byteRangeSet = "500-700,,601-999,"; byteRangeSets = StringUtils.split(byteRangeSet, ','); assertEquals(byteRangeSets.length, 2); String tmp = "hello#$world#%test#$eee"; String[] tmps = StringUtils.splitByWholeSeparator(tmp, "#$"); System.out.println(Arrays.toString(tmps)); assertEquals(tmps.length, 3); tmp = "hello#$"; tmps = StringUtils.splitByWholeSeparator(tmp, "#$"); System.out.println(Arrays.toString(tmps)); assertEquals(tmps.length, 1); tmp = "#$hello#$"; tmps = StringUtils.splitByWholeSeparator(tmp, "#$"); System.out.println(Arrays.toString(tmps)); assertEquals(tmps.length, 1); tmp = "#$hello"; tmps = StringUtils.splitByWholeSeparator(tmp, "#$"); System.out.println(Arrays.toString(tmps)); assertEquals(tmps.length, 1); tmp = "#$hello#$world#$"; tmps = StringUtils.splitByWholeSeparator(tmp, "#$"); System.out.println(Arrays.toString(tmps)); assertEquals(tmps.length, 2); tmp = "#$hello#$#$world#$"; tmps = StringUtils.splitByWholeSeparator(tmp, "#$"); System.out.println(Arrays.toString(tmps)); assertEquals(tmps.length, 2); }
public static String[] split(String str) { return split(str, null, -1); }
StringUtils { public static String[] split(String str) { return split(str, null, -1); } }
StringUtils { public static String[] split(String str) { return split(str, null, -1); }  }
StringUtils { public static String[] split(String str) { return split(str, null, -1); }  static String[] split(String str); static String[] split(String str, String separatorChars); static String[] split(String str, char separatorChar); static String[] split(String str, String separatorChars, int max); static String[] splitByWholeSeparator(String str, String separator); static String[] splitByWholeSeparator(String str, String separator, int max); static boolean hasText(String str); static boolean hasText(CharSequence str); static boolean hasLength(CharSequence str); static boolean hasLength(String str); static String replace(String s, Map<String, Object> map); static String replace(String s, Object... objs); static String replaceStr(String s, String sub, String with); static String escapeXML(String str); static String unicodeToString(String s); static String getFilenameExtension(String path); static String getFilename(String path); static byte[] getUtf8Bytes(String string); static byte[] getBytes(String string); static int toInt(String string, int from); static void append(StringBuilder buf, byte b, int base); static void append2digits(StringBuilder buf, int i); static String asciiToLowerCase(String s); static String normalizeCharset(String s); static String normalizeCharset(String s, int offset, int length); static boolean isHex(String str, int offset, int length); static String truncate(String str, int maxSize); }
StringUtils { public static String[] split(String str) { return split(str, null, -1); }  static String[] split(String str); static String[] split(String str, String separatorChars); static String[] split(String str, char separatorChar); static String[] split(String str, String separatorChars, int max); static String[] splitByWholeSeparator(String str, String separator); static String[] splitByWholeSeparator(String str, String separator, int max); static boolean hasText(String str); static boolean hasText(CharSequence str); static boolean hasLength(CharSequence str); static boolean hasLength(String str); static String replace(String s, Map<String, Object> map); static String replace(String s, Object... objs); static String replaceStr(String s, String sub, String with); static String escapeXML(String str); static String unicodeToString(String s); static String getFilenameExtension(String path); static String getFilename(String path); static byte[] getUtf8Bytes(String string); static byte[] getBytes(String string); static int toInt(String string, int from); static void append(StringBuilder buf, byte b, int base); static void append2digits(StringBuilder buf, int i); static String asciiToLowerCase(String s); static String normalizeCharset(String s); static String normalizeCharset(String s, int offset, int length); static boolean isHex(String str, int offset, int length); static String truncate(String str, int maxSize); static final String EMPTY; static final String[] EMPTY_STRING_ARRAY; }