Java List to String listToString(List list, String delimiter)

Here you can find the source of listToString(List list, String delimiter)

Description

list To String

License

Apache License

Declaration

public static String listToString(List<String> list, String delimiter) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static String listToString(List<String> list, String delimiter) {
        String ret = "";
        for (int i = 0; i < list.size(); i++) {
            if (i < list.size() - 1) {
                ret += list.get(i) + delimiter;
            } else {
                ret += list.get(i);//from  w w w .  j av  a 2  s  .co m
            }
        }
        return ret;
    }
}

Related

  1. ListToString(List list)
  2. listToString(List list)
  3. listToString(List list)
  4. listToString(List list)
  5. listToString(List list)
  6. listToString(List list, String expr)
  7. listToString(List list, String separator)
  8. listToString(List list, String separator)
  9. listToString(List list, String separator)