List of utility methods to do Array to String
String | toString(Object[] array) to String return toString(array, ", "); |
String | toString(Object[] array) Create a string representation of the given array StringBuffer buf = new StringBuffer(); buf.append(": "); for (int i = 0; i < array.length; i++) { buf.append("["); buf.append(i); buf.append("]: "); buf.append((array[i] == null) ? "null" : array[i]); buf.append(" "); ... |
String | toString(Object[] objects) to String return join(", ", objects); |
String | toString(String arrayName, T[] targets) Constructs a String representation of an array and its values. final int n = targets.length; StringBuilder sb = new StringBuilder(); sb.append(arrayName).append(" { "); for (int i = 0; i < n; i++) { sb.append(targets[i].toString()); if (i + 1 < n) sb.append(","); sb.append(" "); ... |
String | toString(String[] args, char color1, char color2) to String StringBuilder stringBuilder = new StringBuilder(); if (args.length > 1) { for (int iii = 0; iii < args.length - 1; iii++) { stringBuilder.append("\247"); stringBuilder.append(color1); stringBuilder.append(args[iii]); stringBuilder.append("\247"); stringBuilder.append(color2); ... |
String | toString(String[] arguments) Provides a debug helper for printing out all arguments of a process for error tracking. StringBuffer call = new StringBuffer(); for (int j = 0; j < arguments.length; j++) { String arg = arguments[j]; if (arg.indexOf(' ') != -1) { call.append('"').append(arg).append('"'); } else { call.append(arg); call.append(' '); return call.toString(); |
String | toString(String[] array, String delimiter) Converts an array of string to a string concatenation separated by the given delimiter. if (array == null || array.length == 0) { return null; StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { sb.append(array[i]); if (i != array.length - 1) { sb.append(delimiter); ... |
String | toString(String[] line) to String if (line == null) return ""; StringBuilder str = new StringBuilder(512); for (int i = 0; i < line.length; ++i) { if (i != 0) str.append(','); str.append(line[i]); if (str.length() > 0) str.append("\n"); return str.toString(); |
String | toString(String[] paramNames, Object[] params) Converts the parameters to string. StringBuffer sb = new StringBuffer(" Input parameters: {"); if (params != null) { for (int i = 0; i < params.length; i++) { if (i > 0) { sb.append(", "); sb.append(paramNames[i]).append(":").append(toString(params[i])); sb.append("}."); return sb.toString(); |
String | toString(T[] array) to String return toString(Arrays.asList(array));
|