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

StringarrayToString(final Object[] arr)
array To String
if (arr == null) {
    return "";
final StringBuilder sb = new StringBuilder();
for (final Object item : arr) {
    sb.append(item);
return sb.toString();
...
StringarrayToString(final Object[] array)
array To String
String result = "[";
for (int i = 0; i < array.length; ++i) {
    result += array[i].toString();
    if (i < array.length - 1) {
        result += ", ";
result += "]";
...
StringarrayToString(final Object[] array)
Provides a string representation of the provided array of objects.
final StringBuilder builder = new StringBuilder();
builder.append(ARRAY_START);
if (array != null && array.length > 0) {
    appendNonEmptyArrayToString(array, builder);
builder.append(ARRAY_END);
return builder.toString();
StringarrayToString(final String[] args)
Converts array to string with comma (,) separated tokens.
if (args == null || args.length == 0)
    return null;
final StringBuilder sb = new StringBuilder();
for (String arg : args)
    sb.append(arg).append(",");
return sb.substring(0, sb.length() - 1);
StringarrayToString(final String[] strs)
Returns the string representation as strs .
return arrayToString(strs, ESCAPE, COMMA);
StringarrayToString(final String[] value)
Converts a String[] to a single String
if (value == null || value.length == 0)
    return "";
StringBuilder buff = new StringBuilder(value[0]);
for (int i = 1; i < value.length; ++i)
    buff.append("*").append(value[i]);
return buff.toString();
StringarrayToString(final String[] values)
array To String
boolean isFirst = true;
StringBuilder str = new StringBuilder();
for (String mode : values) {
    if (!isFirst) {
        str.append(',');
    str.append(mode);
    isFirst = false;
...
StringarrayToString(final T... data)
array To String
String sdata = "";
for (final T o : data) {
    sdata += "," + o;
return sdata.substring(1);
StringarrayToString(final T[] array)
array To String
return collectionToString(Arrays.asList(array), DEFAULT_LIST_SEPARATOR);
StringarrayToString(float[] a)
array To String
String result = "";
for (int i = 0; i < a.length; i++) {
    result += floatToString(a[i]) + " ";
return result;