Here you can find the source of arrayToStrings(String[] s, String delimiter)
public static String arrayToStrings(String[] s, String delimiter)
//package com.java2s; /**// ww w .j a v a2 s . com * * Methods Descrip: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. * */ public class Main { public static String arrayToStrings(String[] s, String delimiter) { String res = ""; for (int i = 0; i < s.length; i++) { if (!"".equals(s[i])) { res = res + s[i]; if (i < (s.length - 1)) { res = res + delimiter; } } } return res; } }