Here you can find the source of joinWithSpaces(final String[] cmds)
public static String joinWithSpaces(final String[] cmds)
//package com.java2s; /*/*w w w . j a v a 2 s .com*/ * @author Fabio Zadrozny * Created: June 2005 * License: Common Public License v1.0 */ import java.util.List; public class Main { public static String joinWithSpaces(final String[] cmds) { return join(" ", cmds); } /** * Same as Python join: Go through all the paths in the string and join them * with the passed delimiter. */ public static String join(final String delimiter, final String[] splitted) { final StringBuilder buf = new StringBuilder(splitted.length * 100); for (final String string : splitted) { if (buf.length() > 0) { buf.append(delimiter); } buf.append(string); } return buf.toString(); } /** * Same as Python join: Go through all the paths in the string and join them * with the passed delimiter. */ public static String join(final String delimiter, final List<String> splitted) { final StringBuilder buf = new StringBuilder(splitted.size() * 100); for (final String string : splitted) { if (buf.length() > 0) { buf.append(delimiter); } buf.append(string); } return buf.toString(); } }