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

StringtoDelimitedString(Object[] array, String delimiter)
to Delimited String
return createDelimitedString(Arrays.asList(array), delimiter);
StringtoPrettyString(String[] array)
to Pretty String
StringBuffer buf = new StringBuffer();
buf.append("[");
for (String st : array) {
    buf.append(st);
    buf.append(",");
if (buf.length() > 1)
    ;
...
ObjecttoString(byte[] array)
to String
StringBuilder str = new StringBuilder();
for (int i = 0; i < array.length; i++) {
    str.append(array[i]);
    if (i != array.length - 1)
        str.append(", ");
return str.toString();
StringtoString(Class aClass, Object[] objects)
to String
return getShortName(aClass) + Arrays.asList(objects);
StringtoString(Class[] modelPath)
Converts a model path to a string representation.
return toString(Arrays.asList(modelPath));
StringtoString(final byte[] buffer, final int offset, final int length)
to String
return new String(Arrays.copyOfRange(buffer, offset, offset + length));
StringtoString(final Object[] array)
Takes in an array of Objects and returns a comma String separated list
return toString(Arrays.asList(array));
StringtoString(int X[][])
to String
StringBuffer res = new StringBuffer("{");
for (int row[] : X) {
    if (row != X[0]) {
        res.append(", ");
    res.append(Arrays.toString(row));
res.append("}");
...
StringtoString(int[] a, int maxValues)
Gets a string representation just as Arrays#toString(int[]) , but at most until the given max amount of values.
if (a == null || a.length < maxValues) {
    return Arrays.toString(a);
StringBuilder b = new StringBuilder(maxValues * 7);
b.append("[");
for (int i = 0; i < maxValues; i++) {
    b.append(a[i]);
    b.append(", ");
...
StringtoString(int[] codes)
Translates array of key codes into corresponding string representation.
if (codes.length == 0) {
    return "";
StringBuffer buffer = new StringBuffer();
buffer.append(toString(codes[0]));
for (int i = 1; i < codes.length; i++) {
    String s = toString(codes[i]);
    if (s != null) {
...