List of utility methods to do String Array Join
String | implode(String[] strings, String glue) implode StringBuilder stringBuilder = new StringBuilder(); if (strings == null) return ""; for (int i = 0; i < strings.length; i++) { stringBuilder.append(strings[i]); if (i != strings.length - 1) { stringBuilder.append(glue); return stringBuilder.toString(); |
String | concatenate(String[] elements, String delimiter) concatenate StringBuilder out = new StringBuilder(); for (int i = 0; i < elements.length; i++) { String element = elements[i]; if (i > 0) { out.append(delimiter); out.append(element); return out.toString(); |
String | makeDivideString(String[] arr_str, String divide_str) make Divide String if (arr_str == null) return null; if (arr_str.length == 0) return ""; StringBuilder sb = new StringBuilder(); for (String e : arr_str) { sb.append(e); sb.append(divide_str); ... |
String | join(String spliter, Object[] arr) join if (arr == null || arr.length == 0) { return ""; if (spliter == null) { spliter = ""; StringBuilder builder = new StringBuilder(); for (int i = 0; i < arr.length; i++) { ... |
String | joinStrings(String joiner, Iterable join Strings StringBuilder builder = new StringBuilder(); boolean first = true; for (String part : parts) { if (!first) { builder.append(joiner); builder.append(part); first = false; ... |
String | join(String spliter, Object[] arr) join if (arr == null || arr.length == 0) { return ""; if (spliter == null) { spliter = ""; StringBuilder builder = new StringBuilder(); for (int i = 0; i < arr.length; i++) { ... |
String | join(String[] strings, String separator) join StringBuffer sb = new StringBuffer(); for (int i = 0; i < strings.length; i++) { if (i != 0) sb.append(separator); sb.append(strings[i]); return sb.toString(); |
String | join(String[] s, String glue) join int k = s.length; if (k == 0) return null; StringBuilder out = new StringBuilder(); out.append(s[0]); for (int x = 1; x < k; ++x) out.append(glue).append(s[x]); return out.toString(); ... |
String | join(String delimiter, String[] strings) join if (strings.length == 0) { return ""; StringBuilder stringBuilder = new StringBuilder(); for (String str : strings) { stringBuilder.append(" ").append(str); return stringBuilder.substring(1); ... |
String | join(int[] arr, String delimiter) join if (arr.length == 0) { return ""; StringBuilder sb = new StringBuilder(); for (int i : arr) { sb.append(delimiter).append(Integer.toString(i)); return sb.substring(delimiter.length()); ... |