List of utility methods to do List Join
String | join(List join if (list.isEmpty()) return ""; StringBuilder b = new StringBuilder(); for (String item : list) { if (!ignoreNull || item != null) { b.append(separator).append(item); if (b.length() == 0) { return ""; return b.toString().substring(separator.length()); |
String | join(List join StringBuilder builder = new StringBuilder(); for (int i = 0; i < list.size(); i++) { builder.append(list.get(i)); if (i < list.size() - 1) { builder.append(separator); return builder.toString(); ... |
String | join(List join StringBuilder sb = new StringBuilder(); if (strList != null && !strList.isEmpty()) { boolean isFirst = true; for (String str : strList) { if (isFirst) { isFirst = false; } else { sb.append(separator); ... |
String | join(List join return join(list, separator, false);
|
String | join(List join return join(list.toArray(new String[0]), glue); |
String | join(List join if (s == null || s.isEmpty()) { return ""; Iterator<String> iter = s.iterator(); StringBuilder builder = new StringBuilder(iter.next()); while (iter.hasNext()) { builder.append(delimiter).append(iter.next()); return builder.toString(); |
String | implode(List implode StringBuilder stringBuilder = new StringBuilder(); if (strings == null) return ""; for (int i = 0; i < strings.size(); i++) { stringBuilder.append(strings.get(i)); if (i != strings.size() - 1) { stringBuilder.append(glue); return stringBuilder.toString(); |
String | join(List> texts, String separator) join StringBuilder result = new StringBuilder(); for (Object text : texts) { result.append(text); result.append(separator); return result.toString(); |
String | join(String separator, List join StringBuilder sb = new StringBuilder(); for (String item : data) { if (sb.length() > 0) sb.append(separator); sb.append(item); return sb.toString(); |
String | concatenate(List concatenate StringBuilder out = new StringBuilder(); for (int i = 0; i < elements.size(); i++) { String element = elements.get(i); if (i > 0) { out.append(delimiter); out.append(element); return out.toString(); |