Java Utililty Methods List Join

List of utility methods to do List Join

Description

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

Method

Stringjoin(List items, char separator)
Creates a backslash escaped string, joining all the items.
StringBuilder sb = new StringBuilder(items.size() << 3);
boolean first = true;
for (Object o : items) {
    String item = o.toString();
    if (first) {
        first = false;
    } else {
        sb.append(separator);
...
Stringjoin(List items, String delimiter)
Joins a list of items into a delimiter-separated string.
StringBuilder sb = new StringBuilder();
for (int i = 0; i < items.size(); i++) {
    sb.append(items.get(i).toString());
    if (i < items.size() - 1) {
        sb.append(delimiter);
return sb.toString();
...
Stringjoin(List list)
join
StringBuilder sb = new StringBuilder();
if (list != null) {
    int size = list.size();
    if (size > 0) {
        sb.append(list.get(0));
    for (int i = 1; i < size; i++) {
        sb.append(COMMA).append(list.get(i));
...
Stringjoin(List list, String delim)
Creates a single string from a List of strings seperated by a delimiter.
if (list == null || list.size() < 1)
    return null;
StringBuilder buf = new StringBuilder();
Iterator<?> i = list.iterator();
while (i.hasNext()) {
    buf.append(i.next());
    if (i.hasNext())
        buf.append(delim);
...
Stringjoin(List list, String sep)
Assemble a list of items into a single string.
StringBuffer buf = new StringBuffer();
for (int i = 0; i < list.size(); i++) {
    if (i > 0)
        buf.append(sep);
    buf.append(list.get(i).toString());
return buf.toString();
Stringjoin(List objects, String delimiter)
join
String result = "";
for (Object object : objects) {
    if (result.length() > 0)
        result += delimiter;
    result += object.toString();
return result;
Stringjoin(List parts)
join
return join(parts, DEFAULT_DELIM);
Stringjoin(List resultList, String sep)
join
if (null == resultList) {
    return "";
if (resultList.isEmpty()) {
    return "";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < resultList.size(); i++) {
...
Stringjoin(List strings, String delimiter)
Join string pieces and separate with a delimiter.
if (strings == null || delimiter == null) {
    return null;
StringBuffer str = new StringBuffer();
int most = strings.size() - 1;
if (strings.size() > 1) {
    Iterator<?> iter = strings.iterator();
    for (int i = 0; i < most; i++) {
...
Listjoin(List list1, List list2)
join
List<E> joinedList = newList();
if (list1 != null) {
    joinedList.addAll(list1);
if (list2 != null) {
    joinedList.addAll(list2);
return joinedList;
...