parquet-common/src/main/java/org/apache/parquet/Strings.java
public static String join(Iterator<String> iter, String on) {
    StringBuilder sb = new StringBuilder();
    while (iter.hasNext()) {
      sb.append(iter.next());
      if (iter.hasNext()) {
        sb.append(on);
      }
    }
    return sb.toString();
  }
public static String join(Iterator<String> iter, String on) {
    StringBuilder sb = new StringBuilder();
    while (iter.hasNext()) {
      sb.append(iter.next());
      if (iter.hasNext()) {
        sb.append(on);
      }
    }
    return sb.toString();
  }
public static String join ( Iterator < String > iter , String on ) { StringBuilder sb = new StringBuilder ( ) ; while ( iter . hasNext ( ) ) { sb . append ( iter . next ( ) ) ; if ( iter . hasNext ( ) ) { sb . append ( on ) ; } } return sb . toString ( ) ; }
Join an Iterator of Strings into a single string with a delimiter.
For example, join(Arrays.asList("foo","","bar","x"), "|") would return
"foo||bar|x"

@param iter an iterator of strings
@param on the delimiter
@return a single joined string
Join an Iterator of Strings into a single string with a delimiter . For example join ( Arrays . asList ( foo bar x ) | ) would return foo||bar|x