Java List Implode implode(List list, String glue)

Here you can find the source of implode(List list, String glue)

Description

implode

License

Apache License

Declaration

public static String implode(List<String> list, String glue) 

Method Source Code


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

import java.util.*;

public class Main {
    public static String implode(List<String> list, String glue) {
        StringBuilder ret = new StringBuilder();
        for (int i = 0; i < list.size(); i++) {
            if (i != 0) {
                ret.append(glue);/*from   w w w  .ja  v  a  2  s .co  m*/
            }
            ret.append(list.get(i));
        }
        return ret.toString();
    }
}

Related

  1. implode(List list, String deliminator)
  2. implode(List objs, String delim)
  3. implode(List elements, String separator)
  4. implode(List list, String delimiter)
  5. implode(List list, String glue)
  6. implode(List strings, String separator)
  7. implode(List tokens, char separator, char escapeCharacter)
  8. implode(String glue, List list)
  9. implode(String split, List list)