List of utility methods to do List Join
String | join(String joinString, List join StringBuilder sb = new StringBuilder(); for (int i = 0; i < strings.size(); ++i) { sb.append(strings.get(i)); if (i + 1 < strings.size()) { sb.append(joinString); return sb.toString(); ... |
String | join(String joint, List Join all elements as a whole string, using 'joint' to separate each element StringBuilder sb = new StringBuilder(); for (String ele : elements) { if (sb.length() != 0) sb.append(joint); sb.append(ele); return sb.toString(); |
String | join(String sep, List join return join(sep, a.toArray(new String[0])); |
String | join(String separator, Collection> list) join return join(separator, null, null, list);
|
String | join(String separator, Collection Join the strings contained in inputList with the separator. Iterator<String> itty = inputList.iterator();
return join(separator, itty);
|
String | join(String separator, List extends Object> items) join return join(separator, items.toArray(new Object[items.size()])); |
String | join(String separator, List extends Object> objs) Join a list of Strings with a separator. if (objs == null) { throw new IllegalArgumentException("objs is null"); if (objs.isEmpty()) { return EMPTY_STRING; Iterator<? extends Object> i = objs.iterator(); StringBuilder r = new StringBuilder(i.next().toString()); ... |
String | join(String separator, List> elements) Returns a string containing all elements concatenated by a specified separator. if (elements == null || elements.size() == 0) { return ""; StringBuffer sb = new StringBuffer(elements.size() * 3); int i = 0; for (Object elem : elements) { if (i++ > 0) { sb.append(separator); ... |
String | join(String separator, List> items) Returns a string containing the string representation of each item in the given list, separated by the given separator. assert separator != null; assert items != null; StringBuilder sb = new StringBuilder(); boolean first = true; for (Object item : items) { if (!first) { sb.append(separator); sb.append(item); first = false; return sb.toString(); |
String | join(String separator, List join StringBuilder stringBuilder = new StringBuilder(); Iterator<String> iterator = parts.iterator(); while (iterator.hasNext()) { stringBuilder.append(iterator.next()); if (iterator.hasNext()) stringBuilder.append(separator); return stringBuilder.toString(); ... |