List of utility methods to do Collection Join
String | join(Collection Returns the joined string. StringBuilder buff = new StringBuilder(); for (String str : coll) { if (buff.length() > 0) { buff.append(delimiter); buff.append(str); return buff.toString(); ... |
String | join(Collection join return join(collection, ", "); |
String | join(Collection join if (collection != null && collection.size() != 0) { StringBuffer sb = new StringBuffer(); for (String item : collection) { sb.append(item); return sb.toString(); return null; ... |
String | join(Collection Joins the collection of strings into a single string using the specified string as a separator. StringBuilder sb = new StringBuilder(); Iterator<String> it = collection.iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(separator); return sb.toString(); |
String | join(Collection join String constructed = ""; if (collection.isEmpty()) { return constructed; for (String item : collection) { constructed += item + separator; return constructed.substring(0, constructed.length() - separator.length()); ... |
String | join(Collection Joins strings with the separator. if (collection == null) { throw new NullPointerException("The collection parameter is null."); if (separator == null) { throw new NullPointerException("The separator parameter is null."); StringBuilder buf = new StringBuilder(); for (String s : collection) { ... |
String | join(Collection join if (collection == null) return null; if (collection.isEmpty()) return ""; StringBuilder sb = new StringBuilder(); for (String s : collection) { if (sb.length() != 0) sb.append(separator); ... |
String | join(Collection join assert elements != null; assert elements.isEmpty() == false; return String.join(", ", elements); |
String | join(Collection join String ret = null; for (String s : in) { if (ret == null) ret = s; else ret += joinS + s; if (ret == null) ... |
String | join(Collection join String separator = ", "; Iterator<String> iterator = items.iterator(); StringBuilder stringBuilder = new StringBuilder(); if (iterator.hasNext()) { stringBuilder.append(iterator.next()); while (iterator.hasNext()) { stringBuilder.append(separator).append(iterator.next()); return stringBuilder.toString(); |