List of utility methods to do Array to String
String[] | arrayToStringArray(boolean[] values) array To String Array String returnValues[] = new String[values.length]; for (int i = 0; i < values.length; i++) { returnValues[i] = String.valueOf(values[i]); return returnValues; |
String | arrayToStringDelimited(final String[] array, final String delimiter) Array to string delimited. final StringBuilder buffer = new StringBuilder(); final int arrayLength = array != null ? array.length : 0; for (int i = 0; i < arrayLength - 1; i++) { buffer.append(array[i]).append(delimiter); buffer.append(arrayLength > 0 ? array[arrayLength - 1] : ""); return buffer.toString(); |
String | arrayToStringNullable(String[] a) transforms an array of strings to string with removed null elements. if (a == null) { return "[]"; int iMax = a.length - 1; if (iMax == -1) { return "[ ]"; StringBuilder b = new StringBuilder(); ... |
String | arrayToStrings(String[] s, String delimiter) array To Strings String res = ""; for (int i = 0; i < s.length; i++) { if (!"".equals(s[i])) { res = res + s[i]; if (i < (s.length - 1)) { res = res + delimiter; return res; |
String[] | arrayToStringWithDifferenceOrientedFormat(double[] values, int minDigits) array To String With Difference Oriented Format String formatString = formatStringForPrettyPrintingRelatedValues(values, minDigits); String[] ret = new String[values.length]; for (int i = 0; i < values.length; i++) { ret[i] = String.format(formatString, values[i]); return ret; |
String | arrayToStringWithPrefix(T[] array, String splitter, String prefix) array To String With Prefix return prefix + arrayToString(array, splitter + prefix);
|
String | asString(final String[] array) as String return asString(array, 0);
|
String | asString(int[] objects, String separator) as String if (objects == null) return ""; StringBuffer buffer = new StringBuffer(objects.length * 10); int j = 0; for (int i = 0; i < objects.length; i++) { if (j > 0) buffer.append(separator); buffer.append(objects[i]); ... |
String | asString(String[] arrayParameter) as String return Arrays.toString(arrayParameter);
|
String | asString(T[] objects) as String return asString(Arrays.asList(objects));
|