Java String from List stringListToString(final List l, final String separator)

Here you can find the source of stringListToString(final List l, final String separator)

Description

string List To String

License

Open Source License

Declaration

final public static String stringListToString(final List<String> l,
            final String separator) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

import java.util.List;

public class Main {
    final public static String stringListToString(final List<String> l,
            final String separator) {
        final StringBuilder sb = new StringBuilder();
        if ((l != null) && (l.size() > 0)) {
            for (int i = 0; i < l.size() - 1; ++i) {
                sb.append(l.get(i) + separator);
            }//from  w ww.  j av  a2 s. c om
            sb.append(l.get(l.size() - 1));
        }
        return sb.toString();
    }
}

Related

  1. stringListEquals(List left, List right)
  2. stringListString(List list)
  3. stringListToArray(final List list)
  4. stringListToArray(List list)
  5. stringListToArray(List params)
  6. stringListToString(List list)
  7. stringListToString(List list)
  8. stringListToString(List list, String delim)
  9. stringListToString(List ls)