List of utility methods to do List Join
String | join(Collection Create a string representation of a list joined by the given separator StringBuilder sb = new StringBuilder(); Iterator<T> iter = list.iterator(); while (iter.hasNext()) { sb.append(iter.next()); if (iter.hasNext()) sb.append(seperator); return sb.toString(); ... |
String | join(final List list, final String conjunction) join final StringBuilder builder = new StringBuilder(); for (int i = 0; i < list.size() - 1; i++) { builder.append(list.get(i)).append(conjunction); builder.append(list.size() - 1); return builder.toString(); |
String | join(final List toJoin) Joins strings from list of strings, using comma as separator to one string. return join(toJoin, ","); |
String | join(final List extends E> list, final CharSequence delim) join final StringBuffer b = new StringBuffer(); boolean skip = true; for (final E e : list) { if (skip) { skip = false; } else { b.append(delim); b.append(e); return b.toString(); |
String | join(final List> args) join final Iterator iterator = args.iterator(); final Object first = iterator.next(); String res; if (!iterator.hasNext()) { res = String.valueOf(first); } else { final StringBuilder buf = new StringBuilder(256); if (first != null) { ... |
String | join(final List> list, final String separator) join return join(list, separator, separator, "", ""); |
String | join(final List> things, final String on) join final StringBuilder sb = new StringBuilder(); for (final Iterator<?> i = things.iterator(); i.hasNext();) { sb.append(i.next()); if (i.hasNext()) { sb.append(on); return sb.toString(); ... |
String | join(final List Join objects in a list using the specified delimiter. if (list == null || list.size() == 0) { return ""; StringBuffer buf = new StringBuffer(); Iterator<Object> iter = list.iterator(); if (iter.hasNext()) { buf.append(iter.next().toString()); while (iter.hasNext()) { buf.append(delimiter); buf.append(iter.next().toString()); return buf.toString(); |
String | join(final List join final StringBuilder buf = new StringBuilder(array.size() * 16); for (String str : array) { buf.append(str); buf.append(separator); buf.setLength(buf.length() - separator.length()); return buf.toString(); |
String | join(final List Joins elements in a list with separator. StringBuilder sb = new StringBuilder(); for (int i = 0; i < data.size(); i++) { sb.append(data.get(i)); if (i != data.size() - 1) { sb.append(separator); return sb.toString(); ... |