List of utility methods to do List Join
String | join(List Join a given List of String s, separated by a given delimiter. StringBuilder sb = new StringBuilder(); if (values != null && !values.isEmpty()) { sb.append(values.get(0)); for (int i = 1; i < values.size(); i++) { sb.append(delimiter); sb.append(values.get(i)); return sb.toString(); |
String | join(List join StringBuilder sb = new StringBuilder(); int c = values.size(); for (String val : values) { if (c-- > 1) sb.append(val + string); else sb.append(val); return sb.toString(); |
String | join(List Joins a list of words together, separated by a separator string. StringBuilder s = new StringBuilder(); for (String w : words) { if (s.length() > 0) { s.append(separator); s.append(w); return s.toString(); ... |
String | join(List join if (entries == null) { return null; StringBuilder output = new StringBuilder(); Iterator<T> iterEntries = entries.iterator(); while (iterEntries.hasNext()) { T entry = iterEntries.next(); if (entry != null) { ... |
String | join(List join StringBuilder stBld = new StringBuilder(); for (T obj : list) { stBld.append(obj).append(delim); return stBld.substring(0, stBld.length() - 1); |
String | join(List join String joined = null; if (list.size() == 1) { joined = list.get(0).toString(); } else { StringBuilder stBld = new StringBuilder(); for (T obj : list) { stBld.append(obj).append(delim); joined = stBld.substring(0, stBld.length() - 1); return joined; |
String | join(List Create a string out of the list's elements using the given delimiter. if (list.isEmpty()) { return ""; final StringBuilder sb = new StringBuilder(); for (T element : list) { sb.append(element); sb.append(delimiter); sb.delete(sb.length() - delimiter.length(), sb.length()); return sb.toString(); |
String | join(List Join the list with joiner. StringBuilder stringBuilder = new StringBuilder(); if (list == null) { return null; if (list.isEmpty()) { return ""; for (T s : list) { ... |
String | join(List Join list elements into a string. StringBuffer result = new StringBuffer(); Iterator<T> iter = list.iterator(); while (iter.hasNext()) { result.append(iter.next()); if (iter.hasNext()) { result.append(separator); return result.toString(); |
String | join(List join StringBuilder result = new StringBuilder(); for (int i = 0; i < objects.size(); i++) { if (i > 0) { result.append(separator); result.append(objects.get(i).toString()); return result.toString(); ... |