List of utility methods to do Array to String
void | asStringOn(StringBuilder sb, Object[] items, String separator) Copies the array items onto the string builder each delimited by the separator. if (items == null || items.length == 0) { return; sb.append(items[0]); for (int i = 1; i < items.length; i++) { sb.append(separator); sb.append(items[i]); |
String | bitsToString(int[] arr) Returns a string representing an array of 0's and 1's char[] s = new char[arr.length + 1]; Arrays.fill(s, '.'); s[0] = 'c'; for (int i = 0; i < arr.length; i++) { if (arr[i] == 1) { s[i + 1] = '*'; return new String(s); |
String | byteMapToString(Map byte Map To String if (map == null) return null; if (map.isEmpty()) { return map.toString(); String result = "[ "; for (Map.Entry<String, byte[]> entry : map.entrySet()) { result += "{" + entry.getKey() + " : " + Arrays.hashCode(entry.getValue()) + "} "; ... |
String | bytesToString(byte[] buffer) bytes To String byte[] bytes = null; for (int i = 0; i < buffer.length; i++) { if (buffer[i] == '\0') { bytes = Arrays.copyOfRange(buffer, 0, i); break; return new String(bytes); ... |
String | convertArrayToString(double[] p) convert Array To String String s = ""; for (int i = 0; i < p.length; i++) { s += p[i] + ";"; return s; |
String | convertArrayToString(Object param) convert Array To String String ids = ""; if (param != null) { for (String paramValue : (String[]) param) { ids += paramValue + ","; ids = ids.replaceAll(",$", ""); return ids; ... |
String | convertArrayToString(Object[] array, String separator) Converts an array of objects to a plain string with a given separator if (array == null) { return ""; StringBuffer result = new StringBuffer(); for (int i = 0; i < array.length; i++) { result.append(array[i]); result.append(separator); return result.toString(); |
String | convertArrayToString(Object[] ig, int count) convert Array To String if (ig != null && ig.length > 0) { StringBuilder str = new StringBuilder(""); for (int i = 0; i < ig.length && i < count; i++) { str.append(String.valueOf(ig[i])).append(","); return str.substring(0, str.length() - 1); return ""; ... |
String | convertArrayToString(Object[] objArr) convert Array To String if (objArr == null) return "null"; String ret = ""; for (int i = 0; i < objArr.length; i++) { if (i != 0) ret += ","; ret += objArr[i]; return ret; |
String | convertArrayToString(String[] array) converts the specified String array to a token String .
if (array == null || array.length == 0) { return ""; final char token = ','; StringBuffer result = new StringBuffer(); for (int i = 0, size = array.length; i < size; i++) { if (array[i] == null || array[i].length() == 0) { continue; ... |