Java Integer Array to String intArrayToString(int[] a, String separator)

Here you can find the source of intArrayToString(int[] a, String separator)

Description

int Array To String

License

Open Source License

Declaration

public static String intArrayToString(int[] a, String separator) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String intArrayToString(int[] a, String separator) {
        int len = a.length;
        if (len == 0) {
            return "[]";
        }//from w  ww .j ava 2s. co  m
        StringBuilder builder = new StringBuilder();
        builder.append("[ ").append(a[0]);
        if (len > 1) {
            for (int i = 1; i < a.length; i++) {
                builder.append(separator).append(a[i]);
            }
        }
        builder.append(" ]");
        return builder.toString();
    }
}

Related

  1. intArrayAsString(int[] a)
  2. intArrayToString(final int... ints)
  3. intArrayToString(int vals[])
  4. intArraytoString(int[] a)
  5. intArrayToString(int[] a)
  6. intArrayToString(int[] arr)
  7. intArrayToString(int[] array)
  8. intArrayToString(int[] array, boolean whiteSpaceSeperator)
  9. intArrayToString(int[] ia)