List of utility methods to do Array to String
String | arrayToString(String[] args, String delimiter) array To String StringBuilder b = new StringBuilder(); for (String arg : args) { b.append(arg); b.append(delimiter); return b.substring(0, b.length() - delimiter.length()); |
String | arrayToString(String[] arr) Helper method serlializing an array as string using "/" as separator. if (arr != null && arr.length > 0) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < arr.length; i++) { builder.append(arr[i]); if (i < arr.length - 1) { builder.append("/"); return builder.toString(); } else { return "<no values specified>"; |
String | arrayToString(String[] arr, String expr) array To String String strInfo = ""; if (arr != null && arr.length > 0) { StringBuffer sf = new StringBuffer(); for (String str : arr) { sf.append(str); sf.append(expr); strInfo = sf.substring(0, sf.length() - 1); ... |
String | arrayToString(String[] array) Convert an Array to a comma seperated String String output = ""; for (int i = 0; i < array.length; i++) { if (output.equals("")) { output = output + array[i]; } else { output = output + ", " + array[i]; return output; |
String | arrayToString(String[] array) array To String String toReturn = null; if (null != array) { toReturn = ""; for (int i = 0; i < array.length; i++) { toReturn += array[i] + ",\n"; } else { System.out.println("arrayToString(null)!"); ... |
String | arrayToString(String[] array) Returns String representing array of Strings. return Arrays.toString(array);
|
String | arrayToString(String[] array) array To String StringBuilder builder = new StringBuilder(); builder.append("{"); int valCount = 0; for (String val : array) { if (valCount++ > 0) { builder.append(", "); builder.append(val); ... |
String | arrayToString(String[] array) array To String if (array.length == 0) { return "[]"; StringBuilder str = new StringBuilder(); str.append("[").append(array[0]); for (int i = 1; i < array.length; i++) { str.append(" ").append(array[i]); str.append("]"); return str.toString(); |
String | arrayToString(String[] array) array To String if ((array == null) || (array.length == 0)) { return ""; StringBuilder sb = new StringBuilder(); for (String s : array) { sb.append(';'); sb.append(s); return sb.substring(1); |
String | arrayToString(String[] array) Convert array to string of comma separated values. if (array != null && array.length > 0) { return Arrays.deepToString(array).replace(" ", "").replace("[", "").replace("]", ""); return ""; |