List of utility methods to do Iterable Join
String | join(Iterable collection) join collection to string, separator is #DEFAULT_JOIN_SEPARATOR join(null) = ""; join({}) = ""; join({a,b}) = "a,b"; return collection == null ? "" : TextUtils.join( DEFAULT_JOIN_SEPARATOR, collection); |
String | join(Iterable Join a strings Iterable into a single string. StringBuilder builder = new StringBuilder(); for (String s : parts) { builder.append(s).append(delimiter); if (builder.length() > 0) { return builder.substring(0, builder.length() - delimiter.length()); return EMPTY; |
String | join(Iterable make a comma seperated string out a passed list/set of strings StringBuilder builder = new StringBuilder(); for (String s : strings) { builder.append(s).append(", "); String result = builder.toString(); return result.substring(1, result.length() - 2); |
String | join(Iterable extends CharSequence> s, CharSequence delimiter) join int capacity = 0; int delimLength = delimiter.length(); Iterator<? extends CharSequence> iter = s.iterator(); if (iter.hasNext()) { capacity += iter.next().length() + delimLength; StringBuilder buffer = new StringBuilder(capacity); iter = s.iterator(); ... |
String | join(Iterable join StringBuilder sb = new StringBuilder(); boolean isFirst = true; for (T t : iterable) { if (!isFirst) { sb.append(","); isFirst = false; sb.append(t.toString()); ... |