List of utility methods to do Collection Join
String | join(final Collection> items, final String inBetween) Construct a string by toString()ing each item in the collection with inBetween between each item. final StringBuilder builder = new StringBuilder(); for (final Object item : items) { if (builder.length() > 0) builder.append(inBetween); builder.append(item); return builder.toString(); |
String | join(final Collection> list, final String inbetween) join final StringBuilder builder = new StringBuilder(); for (final Object object : list) { if (builder.length() > 0) { builder.append(inbetween); builder.append(object.toString()); return builder.toString(); ... |
String | join(final Collection> strings, String delimeter) Convenience function for joining strings using a delimeter if (delimeter == null) { delimeter = ","; if (strings.isEmpty()) { return ""; StringBuffer joined = new StringBuffer(); Iterator<?> stringIter = strings.iterator(); ... |
String | join(final Collection join if (values == null) return ""; StringBuilder sb = new StringBuilder(); Iterator<Object> it = values.iterator(); while (it.hasNext()) { sb.append(String.valueOf(it.next())); if (it.hasNext()) sb.append(separator); ... |
String | join(final Collection Join the given strings into a single string separated by the given separator. final StringBuilder sb = new StringBuilder(); Iterator<String> i = aStrings.iterator(); while (i.hasNext()) { sb.append(i.next()); if (i.hasNext()) { sb.append(aSeparator); return sb.toString(); |
String | join(final Collection Join a collection of strings together into one. StringBuilder sb = new StringBuilder(); if (!chunks.isEmpty()) { Iterator<String> itr = chunks.iterator(); sb.append(itr.next()); while (itr.hasNext()) { sb.append(delimiter); sb.append(itr.next()); return sb.toString(); |
String | join(final Collection join if (collection == null || collection.isEmpty()) { return null; final StringBuilder buffer = new StringBuilder(); for (final Iterator<String> iterator = collection.iterator(); iterator.hasNext();) { buffer.append(iterator.next()); if (iterator.hasNext()) { buffer.append(separator); ... |
String | join(final Collection Join a list of strings into a single string with a separator final StringBuilder sb = new StringBuilder(); for (final String s : list) { if (sb.length() > 0) { sb.append(separator); sb.append(s); return sb.toString(); ... |
String | join(final Collection join if (null == seq || seq.size() < 1) { return ""; } else { StringBuilder aim = new StringBuilder(); for (String one : seq) { if (null != delimiter && aim.length() > 0) { aim.append(delimiter); aim.append(one); return aim.toString(); |
String | join(final Collection join if (strs == null || strs.isEmpty()) { return ""; Iterator<String> it = strs.iterator(); if (strs.size() == 1) { return it.next(); StringBuilder sb = new StringBuilder(it.next()); ... |