Here you can find the source of toString(String[] collection, char separator)
CollectionUtils.toString
.
public static String toString(String[] collection, char separator)
//package com.java2s; // Metawidget (licensed under LGPL) import java.util.Collection; public class Main { /**/*w ww .ja v a2s . c om*/ * GWT-ified <code>CollectionUtils.toString</code>. * <p> * This version does not use regular expressions. */ public static String toString(String[] collection, char separator) { if (collection == null) { return ""; } StringBuilder builder = new StringBuilder(); for (String item : collection) { if (builder.length() > 0) { builder.append(separator); } builder.append(item); } return builder.toString(); } /** * GWT-ified <code>CollectionUtils.toString</code>. * <p> * This version does not use regular expressions. */ public static String toString(Collection<?> collection, char separator) { if (collection == null) { return ""; } StringBuilder builder = new StringBuilder(); for (Object item : collection) { if (builder.length() > 0) { builder.append(separator); } builder.append(item); } return builder.toString(); } }