Java Array to String arrayToString(Object[] objs)

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

Description

Returns a String containing all the objects

License

Apache License

Parameter

Parameter Description
objs a parameter

Return

the String containing all the objects

Declaration

public static String arrayToString(Object[] objs) 

Method Source Code

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

public class Main {
    /**//w w  w .j ava2  s  .c o m
     * Returns a String containing all the objects
     * 
     * @param objs
     * @return the String containing all the objects
     */
    public static String arrayToString(Object[] objs) {
        return arrayToString(objs, "");
    }

    /**
     * Returns a String containing all the objects
     * 
     * @param objs
     *            an array of Object objects
     * @param delimiter
     *            the delimiter between object's Strings
     * @return the String containing all the objects
     */
    public static String arrayToString(Object[] objs, String delimiter) {
        StringBuffer sb = new StringBuffer("");
        for (int i = 0; i < objs.length; i++) {
            sb.append(" #" + i + ": " + objs[i] + delimiter);
        }
        return sb.toString();
    }
}

Related

  1. arrayToString(Object[] list)
  2. arrayToString(Object[] objects)
  3. arrayToString(Object[] objects)
  4. arrayToString(Object[] objects)
  5. arrayToString(Object[] objects)
  6. arrayToString(Object[] objs)
  7. arrayToString(Object[] objs, boolean stripPackageNames)
  8. arrayToString(Object[] objs, String separator)
  9. ArrayToString(Object[] row, StringBuilder sbf)