List of utility methods to do Iterable Join
String | join(Iterable Join string representation of the elements of the given collection separated with the given delimiter. if (null == sequence) { return "null"; if (null == delimiter) { delimiter = ""; Iterator<T> iterator = sequence.iterator(); if (!iterator.hasNext()) { ... |
String | join(Iterable join if (values == null) { return ""; Iterator<T> iter = values.iterator(); if (!iter.hasNext()) { return ""; StringBuffer toReturn = new StringBuffer(stringVal(iter.next())); ... |
String | join(Iterable join if (values == null) { return ""; Iterator<T> iter = values.iterator(); if (!iter.hasNext()) { return ""; StringBuffer toReturn = new StringBuffer(String.valueOf(iter.next())); ... |
String | join(Iterator> iterator, String separator) Joins the elements of the provided Iterator into a single String containing the provided elements. No delimiter is added before or after the list. final String empty = ""; if (iterator == null) { return null; if (!iterator.hasNext()) { return empty; Object first = iterator.next(); ... |
String | join(String delimiter, Iterable Join multiple strings with delimiter. if (strings == null) { return null; int len = 0; int count = 0; for (String s : strings) { len += s.length(); ++count; ... |
String | join(String delimiter, Iterable join List<String> strings = new LinkedList<>(); Iterator<String> iterator = stringsIterable.iterator(); while (iterator.hasNext()) { strings.add(iterator.next()); StringBuilder ab = new StringBuilder(); for (int i = 0; i < strings.size(); i++) { ab.append(strings.get(i)); ... |
String | join(String delimiter, String wrap, Iterable extends Object> objs) join Iterator<? extends Object> iter = objs.iterator(); if (!iter.hasNext()) { return ""; StringBuilder buffer = new StringBuilder(); buffer.append(wrap).append(iter.next()).append(wrap); while (iter.hasNext()) { buffer.append(delimiter).append(wrap).append(iter.next()).append(wrap); ... |
String | join(String glue, Iterable> pieces) Join the toString representations of a list of objects, separated by a given string. StringBuilder result = new StringBuilder(); Iterator<?> it = pieces.iterator(); if (it.hasNext()) { result.append(it.next()); while (it.hasNext()) { result.append(glue); result.append(it.next()); ... |
String | join(String glue, Iterable> tokens) join final StringBuilder sb = new StringBuilder(); final Iterator<?> iterator = tokens.iterator(); while (iterator.hasNext()) { sb.append(iterator.next()); if (iterator.hasNext()) { sb.append(glue); return sb.toString(); |
String | join(String sep, Iterable join return join(sep, strings.iterator());
|