@Test public void testToString() { String[] array = new String[] {"oh", "hello", "world"}; Assert.assertEquals("oh,hello,world", StringUtil.toString(array, ",")); Assert.assertEquals(null, StringUtil.toString(null, ",")); Assert.assertEquals("ohhelloworld", StringUtil.toString(array, null)); System.out.println(String.format("[CRAFT-ATOM-UTIL] (^_^) <%s> Case -> test to string. ", CaseCounter.incr(3))); }
public static String toString(String[] array, String delim) { if (array == null) { return null; } int length = array.length - 1; if (delim == null) { delim = ""; } StringBuilder buf = new StringBuilder(length * 8); for (int i = 0; i < length; i++) { buf.append(array[i]); buf.append(delim); } buf.append(array[length]); return buf.toString(); }
StringUtil { public static String toString(String[] array, String delim) { if (array == null) { return null; } int length = array.length - 1; if (delim == null) { delim = ""; } StringBuilder buf = new StringBuilder(length * 8); for (int i = 0; i < length; i++) { buf.append(array[i]); buf.append(delim); } buf.append(array[length]); return buf.toString(); } }
StringUtil { public static String toString(String[] array, String delim) { if (array == null) { return null; } int length = array.length - 1; if (delim == null) { delim = ""; } StringBuilder buf = new StringBuilder(length * 8); for (int i = 0; i < length; i++) { buf.append(array[i]); buf.append(delim); } buf.append(array[length]); return buf.toString(); } private  StringUtil(); }
StringUtil { public static String toString(String[] array, String delim) { if (array == null) { return null; } int length = array.length - 1; if (delim == null) { delim = ""; } StringBuilder buf = new StringBuilder(length * 8); for (int i = 0; i < length; i++) { buf.append(array[i]); buf.append(delim); } buf.append(array[length]); return buf.toString(); } private  StringUtil(); static String dbc2sbcCase(String src); static String sbc2dbcCase(String src); static String toString(String[] array, String delim); static boolean contains(String[] strings, String string, boolean caseSensitive); static boolean containSubstring(String[] strings, String string, boolean caseSensitive); static int count(String src, String target); static String firstCharToLowerCase(String src); static String firstCharToUpperCase(String src); static String toCurrencyString(String src, Locale locale); static String toCurrencyString(Double src, Locale locale); static String replace(String prefix, String src, String value); static String getReplaceString(String src, String[] values); static String replace(String prefix, String src, String[] values); static String insert(String src, String target, int index); static boolean isEmpty(String str); static boolean isBlank(String str); static boolean isAnyEmpty(String... strings); static boolean isAnyBlank(String... strings); static boolean isAllEmpty(String... strings); static boolean isAllBlank(String... strings); static boolean isAllNotBlank(String... strings); static boolean isAllNotEmpty(String... strings); static boolean isDigitalString(String src); static boolean hasLength(CharSequence src); static boolean hasText(CharSequence str); static String trimAll(String src); static String trimLeading(String str); static String trimTrailing(String str); static String[] split(String str, int num); }
StringUtil { public static String toString(String[] array, String delim) { if (array == null) { return null; } int length = array.length - 1; if (delim == null) { delim = ""; } StringBuilder buf = new StringBuilder(length * 8); for (int i = 0; i < length; i++) { buf.append(array[i]); buf.append(delim); } buf.append(array[length]); return buf.toString(); } private  StringUtil(); static String dbc2sbcCase(String src); static String sbc2dbcCase(String src); static String toString(String[] array, String delim); static boolean contains(String[] strings, String string, boolean caseSensitive); static boolean containSubstring(String[] strings, String string, boolean caseSensitive); static int count(String src, String target); static String firstCharToLowerCase(String src); static String firstCharToUpperCase(String src); static String toCurrencyString(String src, Locale locale); static String toCurrencyString(Double src, Locale locale); static String replace(String prefix, String src, String value); static String getReplaceString(String src, String[] values); static String replace(String prefix, String src, String[] values); static String insert(String src, String target, int index); static boolean isEmpty(String str); static boolean isBlank(String str); static boolean isAnyEmpty(String... strings); static boolean isAnyBlank(String... strings); static boolean isAllEmpty(String... strings); static boolean isAllBlank(String... strings); static boolean isAllNotBlank(String... strings); static boolean isAllNotEmpty(String... strings); static boolean isDigitalString(String src); static boolean hasLength(CharSequence src); static boolean hasText(CharSequence str); static String trimAll(String src); static String trimLeading(String str); static String trimTrailing(String str); static String[] split(String str, int num);  }