List of utility methods to do String Join
String | join(String delimiter, Collection> objects) Joins a collection of objects with given delimiter. StringBuilder sb = new StringBuilder(); for (Object part : objects) { sb.append(part.toString()).append(delimiter); if (sb.length() > delimiter.length()) { sb.delete(sb.length() - delimiter.length(), sb.length()); return sb.toString(); ... |
String | join(String delimiter, Collection Join one or more items placing the specified delimiter between each item StringBuilder buffer = new StringBuilder(); if (delimiter == null) { delimiter = ""; if (items != null) { for (String item : items) { if (item != null) { buffer.append(item); ... |
String | join(String delimiter, Iterable Join a list of elements into a single string with the specified delimiter. if (delimiter == null) { delimiter = ""; StringBuilder sb = new StringBuilder(); for (String element : elements) { if (!isEmpty(element)) { if (sb.length() > 0) { sb.append(delimiter); ... |
String | join(String delimiter, Iterable Joins the given Strings together using the delimiter String del = ""; StringBuilder sb = new StringBuilder(); for (String token : strings) sb.append(del).append(token); del = delimiter; return sb.toString(); ... |
String | join(String delimiter, Iterable join StringBuilder sb = new StringBuilder(); boolean first = true; for (String str : strings) { if (first) { first = false; } else { sb.append(delimiter); sb.append(str); return sb.toString(); |
String | join(String delimiter, Object... objects) join return join(delimiter, Arrays.asList(objects));
|
String | join(String delimiter, Object... parts) join return join(Arrays.asList(parts), delimiter);
|
String | join(String delimiter, String... items) join return join(delimiter, Arrays.asList(items));
|
String | join(String delimiter, String... params) Joins the given params using delimiter. return join(delimiter, Arrays.asList(params));
|
String | join(String delimiter, String... strings) Joins the given strings. if (strings == null || strings.length == 0) { return null; } else { StringBuilder result = new StringBuilder(strings[0]); for (int i = 1; i < strings.length; i++) { result.append(delimiter); result.append(strings[i]); return result.toString(); |