Java List Concatenate concat(List strings, String separator)

Here you can find the source of concat(List strings, String separator)

Description

concat

License

Apache License

Declaration

public static String concat(List<String> strings, String separator) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String concat(List<String> strings, String separator) {
        StringBuilder sb = new StringBuilder();
        String sep = "";
        for (String s : strings) {
            sb.append(sep).append(s);// ww w  .j  a v a  2  s .c  o  m
            sep = separator;
        }
        return sb.toString();
    }
}

Related

  1. concat(List list1, List list2)
  2. concat(List list, String delim)
  3. concat(List lista, List listb)
  4. concat(List items, String quotation, String separation)
  5. concat(List items, String separator)
  6. concat(List tokens)
  7. concat(List words)
  8. concat(List... lists)
  9. concat(List lista, String sep, StringBuilder destino)