Java Array to String arrayToString(Object[] array, String split)

Here you can find the source of arrayToString(Object[] array, String split)

Description

array To String

License

Apache License

Declaration

public static String arrayToString(Object[] array, String split) 

Method Source Code

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

public class Main {

    public static String arrayToString(Object[] array, String split) {
        if (array == null) {
            return "";
        } else {//  ww w  . j a va  2  s  . c o m
            StringBuffer str = new StringBuffer("");

            for (int i = 0; i < array.length; ++i) {
                if (i != array.length - 1) {
                    str.append(array[i].toString()).append(split);
                } else {
                    str.append(array[i].toString());
                }
            }

            return str.toString();
        }
    }
}

Related

  1. arrayToString(Object[] array, String delim, int maxValues, boolean useBrackets)
  2. arrayToString(Object[] array, String prefix, String suffix, String separator)
  3. arrayToString(Object[] array, String sep)
  4. arrayToString(Object[] array, String separator)
  5. arrayToString(Object[] array, String separator)
  6. arrayToString(Object[] ary)
  7. arrayToString(Object[] list)
  8. arrayToString(Object[] objects)
  9. arrayToString(Object[] objects)