Join the Collection of Strings using the specified delimter and optionally quoting each

@param s
The String collection
@param delimiter
the delimiter String
@param doQuote
whether or not to quote the Strings
@return The joined String
970115
public static String join(Collection<String> s, String delimiter, boolean doQuote) {
        StringBuffer buffer = new StringBuffer();
        Iterator<String> iter = s.iterator();
        while (iter.hasNext()) {
            if (doQuote) {
                buffer.append("\"" + iter.next() + "\"");
            } else {
                buffer.append(iter.next());
            }
            if (iter.hasNext()) {
                buffer.append(delimiter);
            }
        }
        return buffer.toString();
    }
418905
public static String join(final Collection<String> chunks,
    final String delimiter) {
    StringBuilder sb = new StringBuilder();
    if (!chunks.isEmpty()) {
      Iterator<String> itr = chunks.iterator();
      sb.append(itr.next());
      while (itr.hasNext()) {
        sb.append(delimiter);
        sb.append(itr.next());
      }
    }
    return sb.toString();
  }
662257
public static String joinAsString( Object[] objects, String separator )
    {
        StringBuilder result = new StringBuilder();
        for (int i = 0; i < objects.length; i++)
        {
            Object element = objects[i];
            result.append( String.valueOf( element ) );
            if (i < objects.length - 1) result.append( separator );
        }
        return result.toString();
    }
466483
protected String join(Collection<?> list, String delimiter) {
        return Joiner.on(delimiter).join(list);
    }
931475
public static String join(final List<String> strings, final char delimiter) {
        StringBuilder builder = new StringBuilder();
        for (String element : strings) {
            if (builder.length() != 0) {
                builder.append(delimiter);
            }
            builder.append(element);
        }
        return builder.toString();
    }
609947
public static String joiningWith(Stream<String> stringStream,
            CharSequence delimiter) {
        return stringStream.collect(Collectors.joining(delimiter));
    }
1135212
private static String join(String delimToUse, INCLUDE... include) {
        String delim = "";
        StringBuilder sb = new StringBuilder();
        for (INCLUDE i : include) {
            sb.append(delim).append(i);
            delim = delimToUse;
        }
        return sb.toString();
    }
811476
public static String toDelimitedString(Collection<?> list, String delim) {
        if (list == null || list.isEmpty()) {
            return EMPTY;
        }
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for (Object o : list) {
            if (!first) {
                sb.append(delim);
            }
            sb.append(o);
            first = false;
        }
        return sb.toString();
    }
8784
public static String stringJoin(List list, String separator) {
        StringBuilder ret = new StringBuilder();
        boolean first = true;
        for (Object o : list) {
            if (!first) {
                ret.append(separator);
            }
            ret.append(o);
            first = false;
        }
        return ret.toString();
    }
350987
public static String joiningWithDelimiter(CharSequence delimiter,
            List<String> stringList) {
        return joiningWith(stringList.stream(), delimiter);
    }
1198278
public static String join(Collection strings, String sep) {
        return join(strings.iterator(), sep);
    }
812344
public static String quote(String s, String delim)
    {
        if (s==null)
            return null;
        if (s.length()==0)
            return "\"\"";

        
        for (int i=0;i<s.length();i++)
        {
            char c = s.charAt(i);
            if (c=='"' ||
                c=='\\' ||
                c=='\'' ||
                delim.indexOf(c)>=0)
            {
                StringBuffer b=new StringBuffer(s.length()+8);
                quote(b,s);
                return b.toString();
            }
        }
        
        return s;
    }
939312
public static String quote(String s) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            buf.append(quote(s.charAt(i)));
        }
        return buf.toString();
    }
473805
public static String join(final Collection<String> list, final String separator) {
        final StringBuilder sb = new StringBuilder();
        for (final String s : list) {
            if (sb.length() > 0) {
                sb.append(separator);
            }
            sb.append(s);
        }
        return sb.toString();
    }
694743
public static String joinAndQuote(List<String> commandList1, Converter<String, String> quote) {
        String join = DataContextUtils.join(commandList1, " ");
        if (null != quote) {
            join = quote.convert(join);
        }
        return join;
    }
62159
public static <T> String join(String delimiter, Collection<T> strings) {
        StringBuilder builder = new StringBuilder();
        boolean first = true;
        for (T o : strings) {
            if (first) {
                first = false;
            } else {
                builder.append(delimiter);
            }
            builder.append(Objects.toString(o));
        }
        return builder.toString();
    }
541562
@SuppressWarnings("SameParameterValue")
  static CodeBlock join(Iterable<CodeBlock> codeBlocks, String delimiter) {
    CodeBlock.Builder builder = CodeBlock.builder();
    Iterator<CodeBlock> iterator = codeBlocks.iterator();
    while (iterator.hasNext()) {
      builder.add(iterator.next());
      if (iterator.hasNext()) {
        builder.add(delimiter);
      }
    }
    return builder.build();
  }