List of utility methods to do Array to Delimited String
String | arrayAsCommaSeperatedList(String... items) array As Comma Seperated List String result = items[0]; for (int i = 1; i < items.length; i++) { result += "," + items[i]; return result; |
String | arrayAsString(final int[] _intArray) Utility method (debug/test): Trivial helper function for quick trace output. String strArray = ""; for (int i = 0; i < _intArray.length; i++) strArray += _intArray[i] + " "; return strArray; |
String | arrayToCommaDelimitedString(Object[] arr) Convenience method to return a String array as a CSV String. return arrayToDelimitedString(arr, ","); |
String | arrayToCommaDelimitedString(Object[] arr) array To Comma Delimited String return arrayToDelimitedString(arr, ","); |
String | arrayToCommaDelimitedString(Object[] strings) Turns this string array in one comma-delimited string. if (strings == null) { return ""; StringBuilder builder = new StringBuilder(); for (int i = 0; i < strings.length; i++) { if (i > 0) { builder.append(","); builder.append(String.valueOf(strings[i])); return builder.toString(); |
String | arrayToCommaSeparatedString(int[] array) array To Comma Separated String if (array == null) { return null; StringBuffer result = new StringBuffer(); for (int i = 0; i < array.length; i++) { result.append(array[i] + (i == array.length - 1 ? "" : ", ")); return result.toString(); ... |
String | arrayToCommaString(int[] array) array To Comma String StringBuffer sb = new StringBuffer(); for (int i = array.length - 1; i >= 0; i--) { if (array[i] == 0) { continue; sb.append(array[i]); sb.append(i == 0 ? "" : ","); return sb.toString(); |
String | arrayToCommaString(int[] array) array To Comma String StringBuffer sb = new StringBuffer(); for (int i = array.length - 1; i >= 0; i--) { if (array[i] == 0) { continue; sb.append(array[i]); sb.append(i == 0 ? "" : ","); return sb.toString(); |
String | arrayToDelimitedString(Object[] arr, String delim) array To Delimited String if (arr == null || arr.length == 0) { return ""; StringBuffer sb = new StringBuffer(); for (int i = 0; i < arr.length; i++) { if (i > 0) { sb.append(delim); sb.append('\''); sb.append(arr[i]); sb.append('\''); return sb.toString(); |
String | arrayToDelimitedString(Object[] arr, String delim) Convenience method to return a String array as a delimited (e.g. if (arr == null) return "null"; else { StringBuffer sb = new StringBuffer(); for (int i = 0; i < arr.length; i++) { if (i > 0) sb.append(delim); sb.append(arr[i]); ... |