Java Utililty Methods Collection Join

List of utility methods to do Collection Join

Description

The list of methods to do Collection Join are organized into topic(s).

Method

Stringjoin(Collection strings, String delimiter)
Joins the given collection of string into a single string, each separated by the given delimiter.
if (strings.isEmpty()) {
    return "";
StringBuffer buffer = new StringBuffer();
join(strings, delimiter, buffer);
return buffer.toString();
Stringjoin(Collection strings, String delimiter)
join
if (strings == null) {
    throw new IllegalArgumentException("strings is null");
if (delimiter == null) {
    throw new IllegalArgumentException("delimiter is null");
StringBuilder builder = new StringBuilder();
for (Iterator<String> iterator = strings.iterator(); iterator.hasNext();) {
...
Stringjoin(Collection strings, String delimiter)
join
return join((String[]) strings.toArray(new String[0]), delimiter);
Stringjoin(Collection strings, String delimiter)
Join string pieces and separate with a delimiter.
if (strings == null || delimiter == null) {
    return null;
StringBuffer str = new StringBuffer();
Iterator<String> iter = strings.iterator();
while (iter.hasNext()) {
    str.append(iter.next());
    if (iter.hasNext()) {
...
Stringjoin(Collection strings, String sep)
join
if (strings.isEmpty()) {
    return "";
StringBuilder sb = new StringBuilder();
for (String parameterName : strings) {
    sb.append(parameterName).append(sep);
String names = sb.substring(0, sb.length() - sep.length());
...
Stringjoin(Collection strings, String sep)
join
StringBuilder buf = new StringBuilder();
for (String str : strings) {
    buf.append(sep).append(str);
return buf.substring(sep.length());
Stringjoin(Collection strings, String separator)
Join a Collection of String with the given separator
return join(strings.toArray(new String[strings.size()]), separator);
Stringjoin(Collection strings, String separator)
join
Iterator<String> iter = strings.iterator();
StringBuilder sb = new StringBuilder();
while (iter.hasNext()) {
    sb.append(iter.next());
    if (iter.hasNext()) {
        sb.append(separator);
return sb.toString();
Stringjoin(Collection strings, String token)
Joins a list of strings.
return join(strings.toArray(new String[strings.size()]), token);
Stringjoin(Collection strs, String sep)
join
StringBuilder bud = new StringBuilder();
for (String s : strs) {
    if (bud.length() > 0)
        bud.append(sep);
    bud.append(s);
return bud.toString();