List of utility methods to do Array to String
String | arrayToString(String[] strs) Given an array of strings, return a comma-separated list of its elements. if (strs.length == 0) { return ""; StringBuffer sbuf = new StringBuffer(); sbuf.append(strs[0]); for (int idx = 1; idx < strs.length; idx++) { sbuf.append(","); sbuf.append(strs[idx]); ... |
String | arrayToString(String[] strs) Given an array of strings, return a comma-separated list of its elements. if (strs.length == 0) { return ""; StringBuffer sbuf = new StringBuffer(); sbuf.append(strs[0]); for (int idx = 1; idx < strs.length; idx++) { sbuf.append(","); sbuf.append(strs[idx]); ... |
String | arrayToString(String[] strs, String separator) array To String if (null == separator || "".equalsIgnoreCase(separator)) { separator = DEFAULT_SEPARATOR; if (strs.length == 0) { return ""; StringBuffer sbuf = new StringBuffer(); sbuf.append(strs[0]); ... |
String | arrayToString(String[] theArray) array To String String myString = ""; for (int i = 0; i < theArray.length; i++) { myString += theArray[i] + ","; myString = myString.substring(0, myString.length() - 1); return myString; |
String | ArrayToString(String[] values) Array To String return ArrayToString(values, ','); |
String | arrayToString(String[] values) Converts a string array to a string. StringBuffer buffer = new StringBuffer(); if (values == null) { buffer.append("null"); } else { buffer.append("{"); for (int i = 0; i < values.length; i++) { buffer.append(values[i]); if (i < values.length - 1) { ... |
String | arrayToString(String[] values) array To String StringBuilder paramsString = new StringBuilder(); for (int i = 0; i < values.length; i++) { if (i == 0) { paramsString.append(values[i]); } else { paramsString.append(","); paramsString.append(values[i]); return paramsString.toString(); |
String | arrayToString(String[] values) array To String if (values == null || values.length == 0) return ""; StringBuilder sb = new StringBuilder(values.length); for (int i = 0; i < values.length; i++) { if (i > 0) sb.append(','); sb.append(values[i]); return sb.toString(); |
String | arrayToString(String[] values) Converts String array to a string representation of List. StringBuilder valueStr = new StringBuilder(); if ((null == values) || (values.length == 0)) { valueStr.append("[]"); } else { valueStr.append("["); for (String value : values) { valueStr.append("'").append(value).append("',"); valueStr.deleteCharAt(valueStr.lastIndexOf(",")); valueStr.append("]"); return valueStr.toString(); |
String | arrayToString(String[] values) A method to take an array of values and return them in a comma delimited list return java.util.Arrays.toString(values).replaceAll("[\\]\\[]", ""); |