Java Array to String array2String(T... array)

Here you can find the source of array2String(T... array)

Description

array String

License

Apache License

Declaration

public static <T> String array2String(T... array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static <T> String array2String(T... array) {
        int len = array.length;
        if (len == 0) {
            return "";
        }/*from w  w  w. j av a  2 s.  c  o m*/

        StringBuilder sb = new StringBuilder();
        sb.append("[").append(array[0]);
        for (int i = 1; i < array.length; i++) {
            sb.append(",").append(array[i]);
        }
        sb.append("]");

        return sb.toString();
    }
}

Related

  1. array2String(String[] array)
  2. array2String(String[] array)
  3. array2String(String[] category)
  4. array2String(String[] p, String spliter)
  5. Array2String(String[] values)
  6. array2String(T[] array, String splitFlag, boolean useBracket)
  7. arrayContent(int[] ar)
  8. arrayToRLEString(int[] a)
  9. arrayToRLEString(short[] a)