Here you can find the source of arrayToString(String[] array)
Parameter | Description |
---|---|
array | An array of Strings. |
public static String arrayToString(String[] array)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2013 Nokia Siemens Networks Oyj, Finland. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * /*from ww w .ja v a2 s . c om*/ * Contributors: * Nokia Siemens Networks - initial implementation * Petri Tuononen - Initial implementation *******************************************************************************/ public class Main { /** * Append an array of Strings to a String separated by a path separator. * * @param array An array of Strings. * @return string which contains all indexes of * a String array separated by a path separator. */ public static String arrayToString(String[] array) { StringBuffer sB = new StringBuffer(); //if array isn't empty and doesn't contain an empty String if (array.length > 0 /*&& !array[0].equals("")*/) { for (String i : array) { sB.append(i); sB.append(System.getProperty("path.separator")); //$NON-NLS-1$ } } return sB.toString(); } }