List of utility methods to do Array Join
String | join(String[] inputArray, String glueString) Method to join array elements of type string String output = ""; if (inputArray.length > 0) { StringBuilder sb = new StringBuilder(); if (!inputArray[0].isEmpty()) { sb.append(inputArray[0]); for (int i = 1; i < inputArray.length; i++) { if (!inputArray[i].isEmpty()) { ... |
String | join(String[] items, String delimiter) Joins string items into one string separated by delimiter. StringBuilder result = new StringBuilder(); if (items != null) for (String item : items) { if (result.length() > 0 && !isEmpty(delimiter)) result.append(delimiter); result.append(item); return result.toString(); ... |
String | join(String[] lines, String delim) Returns a single string that interpolates the strings in lines by the delimiters delim. StringBuilder buffer = new StringBuilder(); for (int i = 0; i < lines.length; i++) { if (i > 0) { buffer.append(delim); buffer.append(lines[i]); return buffer.toString(); ... |
String | join(String[] lines, String sep) join StringBuilder buf = new StringBuilder(); if (lines != null) for (String line : lines) { if (buf.length() > 0) { buf.append(sep); buf.append(line); return buf.toString(); |
String | join(String[] lines, String separator) join final StringBuffer sb = new StringBuffer(256); for (int i = 0; i < lines.length; ++i) { if (i != 0) { sb.append(separator); sb.append(lines[i]); return sb.toString(); ... |
String | join(String[] names, String sep) Concatenate the strings in @p names, placing @p sep between each (except at the end) and return the resulting string. if (names == null) { return null; int l = names.length; if (l < 1) { return ""; StringBuilder b = new StringBuilder(l * sep.length() + l + 1); ... |
String | join(String[] parts, String separator) join return join(Arrays.asList(parts), separator);
|
String | join(String[] sentence, String separator) join String result = ""; for (int i = 0; i < sentence.length; i++) { String word = sentence[i]; result += word + separator; return result.trim(); |
String | join(String[] strArr) join if (strArr == null) return null; StringBuilder ret = new StringBuilder(); for (int i = 0, len = strArr.length; i < len; i++) { ret.append(strArr[i]); if (i < len - 1) { ret.append(","); return ret.toString(); |
String | join(String[] strArray, String delimiter) join StringBuilder result = new StringBuilder(); for (int i = 0, arrayLength = strArray.length; i < arrayLength; i++) { result.append(strArray[i]); if (i < arrayLength - 1) { result.append(delimiter); return result.toString(); ... |