List of utility methods to do Iterable to String
String | iterableAsString(Iterable Convert an Iterable of Character s to String. StringBuilder builder = new StringBuilder(); for (Character c : chars) { builder.append(c); return builder.toString(); |
String | iterableToString(Iterable> iterable) This method will format any iterable class into a simple newline delimited list. StringBuilder builder = new StringBuilder(); for (Object obj : iterable) { builder.append(String.format("%s\n", obj.toString())); return builder.toString(); |
String | iterableToString(Iterable> list) iterable To String if (list == null) { return ""; StringBuilder sb = new StringBuilder(); for (Object item : list) { sb.append(item); sb.append(","); if (sb.length() > 0) { sb.deleteCharAt(sb.length() - 1); return sb.toString(); |
String | iterableToString(Iterable iterable To String StringBuilder sb = new StringBuilder("["); for (Iterator<CharSequence> iterator = charSequenceIterable.iterator(); iterator.hasNext();) { CharSequence charSequence = iterator.next(); sb.append(charSequence); if (iterator.hasNext()) { sb.append(", "); sb.append("]"); return sb.toString(); |
String | iterableToString(Iterable iterable To String StringBuffer buff = new StringBuffer(); buff.append("[ "); boolean first = true; for (E elem : itrbl) { if (!first) { buff.append(", "); first = false; ... |
String | iterableToString(Iterable Returns a string representation of the iterable objects. StringBuilder builder = new StringBuilder().append("["); String sep = ""; int head = (limit <= 0) ? Integer.MAX_VALUE : (limit + 1) / 2; int tail = (limit <= 0) ? 0 : limit - head; Iterator<T> iter = objects.iterator(); while (iter.hasNext() && --head >= 0) { builder.append(sep).append(iter.next().toString()); sep = ", "; ... |
String | toString(final Iterable> iterable, final CharSequence delimiter) Converts an iterable to a delimited string. final StringBuilder result = new StringBuilder(); final Iterator<?> iterator = iterable.iterator(); while (iterator.hasNext()) { result.append(iterator.next()); if (iterator.hasNext()) { result.append(delimiter); return result.toString(); |
String | toString(Iterable c, String delim, String prefix, String suffix) to String if (c == null) { return "null"; StringBuffer sb = new StringBuffer(); Iterator it = c.iterator(); int i = 0; while (it.hasNext()) { if (i++ > 0) { ... |
String | toString(Iterable extends Object> objects, String sep) Returns a string that contains all objects separated with the given separator. StringBuilder builder = new StringBuilder(); Iterator<? extends Object> it = objects.iterator(); if (it.hasNext()) { builder.append(it.next()); while (it.hasNext()) { builder.append(sep); builder.append(it.next()); return builder.toString(); |
String | toString(Iterable> it, String separator) to String final StringBuilder builder = new StringBuilder(); final Iterator<?> iterator = it.iterator(); while (iterator.hasNext()) { builder.append(iterator.next().toString()); if (iterator.hasNext()) { builder.append(separator); return builder.toString(); |