List of utility methods to do Collection to String
String | toString(Collection> collection) to String StringBuilder sb = new StringBuilder(collection.size() * 2); for (Object item : collection) { sb.append(item).append(","); return sb.toString(); |
String | toString(Collection> collection, String separator) Flattens a collection elements to a string calling toString() on each element.
String toString = "L[null]"; if (collection != null) { StringBuilder sb = new StringBuilder(collection.size() * 20); String sep = ""; for (Object obj : collection) { sb.append(sep).append(obj); sep = separator; toString = sb.toString(); return toString; |
String | toString(Collection> elements, String separator) to String final int size = elements.size() - 1; if (size >= 0) { final StringBuilder builder = new StringBuilder(); final Iterator<?> iterator = elements.iterator(); for (int i = 0; i < size; i++) { builder.append(iterator.next()); builder.append(separator); return builder.append(iterator.next()).toString(); return ""; |
String | toString(Collection> itemList) to String return printf("[%s]", join(itemList, ", ", "\"%s\"")); |
String | toString(Collection> objects, CharSequence delimiter) to String StringBuilder sb = new StringBuilder(); for (Object o : objects) { sb.append(o.toString()); sb.append(delimiter); sb.setLength(sb.length() - delimiter.length()); return sb.toString(); |
void | toString(Collection to String for (byte[] bs : bytes) { result.add(toString(bs)); |
String | toString(Collection to String if (collection == null) { return ""; StringBuilder builder = new StringBuilder(); for (Object item : collection) { if (item == null) { continue; builder.append(String.valueOf(item)); return builder.toString(); |
String | toString(Collection Convert a Collection of strings to a line separated list of strings. String string = ""; for (Iterator<String> itr = strings.iterator(); itr.hasNext();) { string += itr.next() + "\n"; return string; |
String | toString(Collection to String int n = a.size(); if (n == 0) return begStr + endStr; Iterator<T> it = a.iterator(); String s = begStr + it.next(); while (it.hasNext()) s += sepStr + it.next(); return s + endStr; ... |
String | toString(Collection to String StringBuilder sb = new StringBuilder(); if (collection.size() == 0) { return ""; for (T object : collection) { sb.append(object.toString()); sb.append(","); return sb.substring(0, sb.length() - 1); |