List of utility methods to do Array to Delimited String
String | arrayToDelimitedString(Object[] arr, String delim) Convert a String array into a delimited String (e.g. if (arr == null || arr.length == 0) { return EMPTY; if (arr.length == 1) { return (arr[0] == null) ? EMPTY : arr[0].toString(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { ... |
String | arrayToDelimitedString(String[] values, String delimiter) array To Delimited String StringBuffer str = new StringBuffer(); for (String val : values) { if (str.length() > 0) { str.append(delimiter); str.append(val); return str.toString(); ... |
String | arrayToDelimitedString(T[] array, String left, String delimiter, String right) array To Delimited String return arrayToDelimitedString(array, 0, array.length, left, delimiter, right);
|
String | arrayToReadableString(String[] array) array To Readable String if ((array == null) || (array.length == 0)) { return ""; StringBuilder sb = new StringBuilder(); for (String s : array) { sb.append(", "); sb.append(s); return sb.substring(2); |
String | arrayToTabSeparatedString(final String[] values) array To Tab Separated String boolean isFirst = true; StringBuilder str = new StringBuilder(); for (String mode : values) { if (!isFirst) { str.append("\t"); str.append(mode); isFirst = false; ... |
String | arrayToText(String[] values, String delimiter) make a delimited text out of the array StringBuilder sbf = new StringBuilder(); for (String value : values) { sbf.append(value).append(delimiter); sbf.deleteCharAt(sbf.length() - 1); return sbf.toString(); |