public static String join(CharSequence separator, Iterable<?> strings) {
    Iterator<?> i = strings.iterator();
    if (!i.hasNext()) {
      return "";
    }
    StringBuilder sb = new StringBuilder(i.next().toString());
    while (i.hasNext()) {
      sb.append(separator);
      sb.append(i.next().toString());
    }
    return sb.toString();
  }
Concatenates strings, using a separator.

@param separator Separator to join with.
@param strings Strings to join.
common/src/java/org/apache/hive/common/util/HiveStringUtils.java