code: public static String implode(String[] arr, String delim)
     {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < arr.length; i++)
        {
           if (i > 0)
           {
              buf.append(delim);
           }
           buf.append(arr[i]);
        }
        return buf.toString();
     }
docs: Concatenates all strings in the string array using the specified delimiter.
  
  @param arr
  @param delim
  @return the concatenated string