List of utility methods to do Array Implode
String | implode(String[] values, String separator, String beforeEach, String afterEach) implode StringBuffer result = new StringBuffer(); for (int i = 0; i < values.length; i++) { if (i > 0) result.append(separator); result.append(beforeEach); result.append(values[i]); result.append(afterEach); return result.toString(); |
StringBuilder | implodeArray(Object[] array) Convenience method for this#implodeArray(Object[], String) which uses a Constants#COMMA delimiter. if (null == array) { return null; return implodeArray(array, COMMA); |
String | implodeArray(Object[] items, String prefix, String suffix, String delimiter, String lastItemSuffix) Glue together all items into one String. if (items == null) throw new NullPointerException("items argument may not be null"); if (prefix == null) prefix = ""; if (suffix == null) suffix = ""; if (delimiter == null) delimiter = ""; ... |
String | implodeArray(String[] inputArray, String glueString) implode Array String output = ""; if (inputArray.length > 0) { StringBuilder sb = new StringBuilder(); sb.append(inputArray[0]); for (int i = 1; i < inputArray.length; i++) { sb.append(glueString); sb.append(inputArray[i]); output = sb.toString(); return output; |
String | implodeArray(String[] inputArray, String glueString, int start) implode Array if (inputArray.length > start) { String msg = ""; boolean isFirst = true; for (int i = start; i < inputArray.length; i++) { if (!isFirst) msg += glueString; msg += inputArray[i]; isFirst = false; ... |
String | implodeString(String[] strArray, String strDelim) Returns a delimited string for an given array of string elements. (Based on implode() in PHP) String result = ""; for (String strValue : strArray) result += strValue + strDelim; return result; |
String | implodeStringArray(Object[] pieces, String delim) Implode an object array into a single string, delimited by a given delimiter return implodeStringCollection(Arrays.asList(pieces), delim);
|