Java Utililty Methods Array to String

List of utility methods to do Array to String

Description

The list of methods to do Array to String are organized into topic(s).

Method

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;
StringarrayToStringDelimited(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();
StringarrayToStringNullable(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();
...
StringarrayToStrings(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;
StringarrayToStringWithPrefix(T[] array, String splitter, String prefix)
array To String With Prefix
return prefix + arrayToString(array, splitter + prefix);
StringasString(final String[] array)
as String
return asString(array, 0);
StringasString(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]);
...
StringasString(String[] arrayParameter)
as String
return Arrays.toString(arrayParameter);
StringasString(T[] objects)
as String
return asString(Arrays.asList(objects));