Java List to String listToString(List segs, String splitter)

Here you can find the source of listToString(List segs, String splitter)

Description

list To String

License

Apache License

Declaration

public static String listToString(List<String> segs, String splitter) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String listToString(List<String> segs, String splitter) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < segs.size() - 1; i++) {
            sb.append(segs.get(i));/*  w w w.j  a  v  a2  s. com*/
            sb.append(splitter);
        }
        sb.append(segs.get(segs.size() - 1));
        return sb.toString();
    }
}

Related

  1. listToString(List list, String split)
  2. listToString(List params, String sepator)
  3. listToString(List pListToConvert)
  4. listToString(List queryList, String delimitedString)
  5. listToString(List s, String separator)
  6. listToString(List stringList)
  7. listToString(List tags)
  8. ListToString(List value, String delimiter)
  9. listToString(List list)