List of utility methods to do Array to String
String | array2String(Object[] objs) array String StringBuffer buffer = new StringBuffer(); if (objs != null) { for (int i = 0; i < objs.length; i++) { buffer.append(objs[i]).append(","); buffer.deleteCharAt(buffer.length() - 1); return buffer.toString(); ... |
String | array2String(String[] array) array String if (array == null || array.length <= 0) return null; StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length - 1; i++) { builder.append(array[i]); builder.append(SPLIT_SYMBOL); builder.append(array[array.length - 1]); ... |
String | array2String(String[] array) array String StringBuffer buffer = new StringBuffer(); for (int i = 0; i < array.length; i++) { buffer.append(",").append(array[i]); return buffer.toString().replaceFirst(",", ""); |
String | array2String(String[] category) array String StringBuilder sb = new StringBuilder(); String delim = ""; if (category.length >= 1) { for (int i = 0; i < category.length; i++) { sb.append(delim).append(category[i]); delim = "#"; return sb.toString(); |
String | array2String(String[] p, String spliter) array String if (p == null) return null; StringBuffer sb = new StringBuffer(); for (int i = 0; i < p.length; i++) { if (i == 0) sb.append(p[i]); else sb.append(spliter).append(p[i]); ... |
String | Array2String(String[] values) Array String String result = ""; if (values == null) { return result; int len = values.length; for (int i = 0; i < len; i++) { result += values[i] + ","; if (result.endsWith(",")) { result = result.substring(result.length() - 1); return result; |
String | array2String(T... array) array String int len = array.length; if (len == 0) { return ""; StringBuilder sb = new StringBuilder(); sb.append("[").append(array[0]); for (int i = 1; i < array.length; i++) { sb.append(",").append(array[i]); ... |
String | array2String(T[] array, String splitFlag, boolean useBracket) array String if (array != null && array.length == 0) { return null; StringBuilder sb = new StringBuilder(); for (T t : array) { sb.append(t.toString() + splitFlag); int sbLen = sb.length(); ... |
String | arrayContent(int[] ar) array Content String str = ""; for (int i = 0; i < ar.length; i++) { str += ar[i] + ","; return str; |
String | arrayToRLEString(int[] a) Construct a string representing an int array. StringBuffer buffer = new StringBuffer(); appendInt(buffer, a.length); int runValue = a[0]; int runLength = 1; for (int i = 1; i < a.length; ++i) { int s = a[i]; if (s == runValue && runLength < 0xFFFF) { ++runLength; ... |