List of utility methods to do List Join
String | join(List> items, char separator) Creates a backslash escaped string, joining all the items. StringBuilder sb = new StringBuilder(items.size() << 3); boolean first = true; for (Object o : items) { String item = o.toString(); if (first) { first = false; } else { sb.append(separator); ... |
String | join(List> items, String delimiter) Joins a list of items into a delimiter-separated string. StringBuilder sb = new StringBuilder(); for (int i = 0; i < items.size(); i++) { sb.append(items.get(i).toString()); if (i < items.size() - 1) { sb.append(delimiter); return sb.toString(); ... |
String | join(List> list) join StringBuilder sb = new StringBuilder(); if (list != null) { int size = list.size(); if (size > 0) { sb.append(list.get(0)); for (int i = 1; i < size; i++) { sb.append(COMMA).append(list.get(i)); ... |
String | join(List> list, String delim) Creates a single string from a List of strings seperated by a delimiter. if (list == null || list.size() < 1) return null; StringBuilder buf = new StringBuilder(); Iterator<?> i = list.iterator(); while (i.hasNext()) { buf.append(i.next()); if (i.hasNext()) buf.append(delim); ... |
String | join(List> list, String sep) Assemble a list of items into a single string. StringBuffer buf = new StringBuffer(); for (int i = 0; i < list.size(); i++) { if (i > 0) buf.append(sep); buf.append(list.get(i).toString()); return buf.toString(); |
String | join(List> objects, String delimiter) join String result = ""; for (Object object : objects) { if (result.length() > 0) result += delimiter; result += object.toString(); return result; |
String | join(List> parts) join return join(parts, DEFAULT_DELIM);
|
String | join(List> resultList, String sep) join if (null == resultList) { return ""; if (resultList.isEmpty()) { return ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i < resultList.size(); i++) { ... |
String | join(List> strings, String delimiter) Join string pieces and separate with a delimiter. if (strings == null || delimiter == null) { return null; StringBuffer str = new StringBuffer(); int most = strings.size() - 1; if (strings.size() > 1) { Iterator<?> iter = strings.iterator(); for (int i = 0; i < most; i++) { ... |
List | join(List join List<E> joinedList = newList(); if (list1 != null) { joinedList.addAll(list1); if (list2 != null) { joinedList.addAll(list2); return joinedList; ... |