List of utility methods to do Collection Join
String | join(Collection data) Join the given Collection using the DEFAULT_DELIMITER. return join(data, DEFAULT_DELIMITER);
|
String | join(Collection elements, String separator) join if (elements == null) { throw new NullPointerException(); if (separator == null) { separator = ""; boolean first = true; StringBuilder stringBuilder = new StringBuilder(); ... |
String | join(Collection items) join StringBuilder result = new StringBuilder(); boolean first = true; for (Object o : items) { if (!first) { result.append(","); if (o != null) { result.append(o); ... |
String | join(Collection list, char separator) join if (list == null) { return ""; int size = list.size(); if (size == 0) { return ""; final StringBuilder sb = new StringBuilder(); ... |
String | join(Collection lst, String delim) joins a list into a string. return joinCol(lst, delim);
|
String | join(Collection objects, String glue) same thing as perl's join() StringBuilder builder = new StringBuilder(); for (Object o : objects) { builder.append(o); builder.append(glue); builder.setLength(builder.length() - 1); return builder.toString(); |
String | join(Collection paramCollection, String paramString) join StringBuffer localStringBuffer = new StringBuffer(); while (paramCollection.iterator().hasNext()) { localStringBuffer.append("'" + paramCollection.iterator().next() + "'"); if (!paramCollection.iterator().hasNext()) continue; localStringBuffer.append(paramString); return localStringBuffer.toString(); ... |
String | join(Collection parts, String sep) join StringBuffer sb = new StringBuffer(); int counter = 0; for (Object o : parts) { if (counter != 0) { sb.append(sep); sb.append(o); counter++; ... |
String | join(Collection s, String delimiter) Join a collection, akin to Perl's join(), using a given delimiter to produce a single String if (s == null) { throw new IllegalArgumentException("Collection to join must not be null"); StringBuffer buffer = new StringBuffer(); Iterator iter = s.iterator(); while (iter.hasNext()) { buffer.append(iter.next()); if (iter.hasNext() && delimiter != null) { ... |
String | join(Collection s, String delimiter, boolean doQuote) Join the Collection of Strings using the specified delimter and optionally quoting each StringBuffer buffer = new StringBuffer(); Iterator iter = s.iterator(); while (iter.hasNext()) { if (doQuote) { buffer.append("\"" + iter.next() + "\""); } else { buffer.append(iter.next()); if (iter.hasNext()) { buffer.append(delimiter); return buffer.toString(); |