Here you can find the source of Array2String(String[] values)
public static String Array2String(String[] values)
//package com.java2s; /**/* w w w . ja v a 2 s . c om*/ * Converts a line of text into an array of lower case words using a * BreakIterator.wordInstance(). * <p> * * This method is under the Jive Open Source Software License and was * written by Mark Imbriaco. * * @param text * a String of text to convert into an array of words * @return text broken up into an array of words. */ import java.util.*; public class Main { public static String Array2String(String[] values) { String result = ""; if (values == null) { return result; } int len = values.length; for (int i = 0; i < len; i++) { result += values[i] + ","; } if (result.endsWith(",")) { result = result.substring(result.length() - 1); } return result; } public static String Array2String(Object[] values) { String result = ""; if (values == null) { return result; } int len = values.length; for (int i = 0; i < len; i++) { result += values[i].toString() + ","; } if (result.endsWith(",")) { result = result.substring(result.length() - 1); } return result; } public static String Array2String(List values) { String result = ""; if (values == null) { return result; } int len = values.size(); for (int i = 0; i < len; i++) { result += values.get(i).toString() + ","; } if (result.endsWith(",")) { result = result.substring(result.length() - 1); } return result; } }