Java Array Convert to arrayToLine(Object[] source)

Here you can find the source of arrayToLine(Object[] source)

Description

from array to string.

License

Open Source License

Parameter

Parameter Description
source array

Return

result of toString

Declaration

public static String arrayToLine(Object[] source) 

Method Source Code

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

public class Main {
    /**//from w  w w .  j a v a  2 s.c  om
     * from array to string.
     *
     * @param source array
     * @return result of toString
     */
    public static String arrayToLine(Object[] source) {
        if (source == null) {
            return "";
        }
        StringBuffer buff = new StringBuffer();
        for (int i = 0; i < source.length; i++) {
            if (i != 0) {
                buff.append(",");
            }
            buff.append(source[i]);
        }
        return buff.toString();
    }
}

Related

  1. arrayToDouble(final byte[] array, final int start)
  2. arrayToHTMLString(Object[] objectArray, int indent)
  3. arrayToInt(final byte[] array, final int start)
  4. arrayToJava(double[] v, int off, int len, String name)
  5. arrayToJson(int[] x)
  6. arrayToLines(String[] lines)
  7. arrayToLowercase(String[] array)
  8. arrayToMatlabStringArray(double da[])
  9. arrayToOneLineSpaceDelimitedString(Object obj[])