Java Utililty Methods List to String

List of utility methods to do List to String

Description

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

Method

StringlistToString(final List list, final String separator)
Creates a string representation of the elements in the list separated by separator.
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
    sb.append(list.get(i));
    if (i < list.size() - 1) {
        sb.append(separator);
return sb.toString();
...
StringlistToString(final List list)
list To String
return listToString(list, DEFAULT_DELIMITER);
StringlistToString(final List stringList)
list To String
StringBuffer str = new StringBuffer();
if (isNull(stringList)) {
    return null;
} else {
    for (String string : stringList) {
        str.append(string);
        str.append(",");
return str.toString();
StringlistToString(Iterable list)
list To String
if (list == null) {
    return "";
StringBuilder str = new StringBuilder();
for (Iterator<?> it = list.iterator(); it.hasNext();) {
    Object o = it.next();
    str.append(o);
    if (it.hasNext()) {
...
StringlistToString(List a, String separator)
list To String
StringBuffer result = new StringBuffer();
if (a.size() > 0) {
    result.append(a.get(0).toString());
    for (int i = 1; i < a.size(); i++) {
        result.append(separator);
        result.append(a.get(i).toString());
return result.toString();
StringlistToString(List inList, String delimeter)
listToString
if (inList == null)
    return null;
StringBuffer stBuf = new StringBuffer();
for (Iterator itr = inList.iterator(); itr.hasNext();) {
    if (stBuf.length() > 0) {
        stBuf.append(delimeter);
    stBuf.append((itr.next()).toString());
...
StringlistToString(List l)
list To String
return listToString(l, ", ", "(", ")");
StringlistToString(List l)
Take the List of objects and return a String of all the list's elements toString values appended to each other, separated by semicolons
StringBuffer sb = new StringBuffer();
for (int i = 0; i < l.size(); i++) {
    if (i > 0) {
        sb.append(";");
    sb.append(l.get(i).toString());
return sb.toString();
...
StringlistToString(List list)
list To String
StringBuilder sb = new StringBuilder();
if (list != null && list.size() > 0) {
    for (int i = 0; i < list.size(); i++) {
        if (i < list.size() - 1) {
            sb.append(list.get(i) + ",");
        } else {
            sb.append(list.get(i));
return sb.toString();
StringlistToString(List list)
list To String
String ret = "{";
for (int i = 0; i < list.size(); i++) {
    if (i > 0)
        ret += ", ";
    ret += list.get(i).toString();
ret += "}";
return ret;
...