Here you can find the source of arrayToString(Object[] arr)
public static String arrayToString(Object[] arr)
//package com.java2s; /**/* w w w. j a v a 2 s . c om*/ * The utillib library. * More information is available at http://www.jinchess.com/. * Copyright (C) 2002, 2003 Alexander Maryanovsky. * All rights reserved. * * The utillib library is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * The utillib library is distributed in the hope that it will * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with utillib library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ public class Main { /** * Converts the specified array into a string by appending all its elements * separated by a semicolon. */ public static String arrayToString(Object[] arr) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < arr.length; i++) { buf.append(arr[i]); buf.append("; "); } if (arr.length > 0) buf.setLength(buf.length() - 2); // get rid of the extra "; " return buf.toString(); } }