Here you can find the source of objectArrayToString(String separator, Object... objects)
public static String objectArrayToString(String separator, Object... objects)
//package com.java2s; public class Main { /**//from w w w . ja va2 s.c o m * Returns a string which is a concatenation of the {@link #toString()} of the * objects passed to the method, separated by {@link #separator} */ public static String objectArrayToString(String separator, Object... objects) { StringBuffer buffer = new StringBuffer(); for (Object obj : objects) { buffer.append(obj.toString()).append(separator); } String res = buffer.toString(); if (res.lastIndexOf(separator) == -1) { return res; } return res.substring(0, res.lastIndexOf(separator)); } }