Java List Join joinStrings(String delim, List strings)

Here you can find the source of joinStrings(String delim, List strings)

Description

join Strings

License

Open Source License

Declaration

public static String joinStrings(String delim, List<?> strings) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static String joinStrings(String delim, List<?> strings) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strings.size(); ++i) {
            sb.append(strings.get(i).toString());
            if (i < strings.size() - 1) {
                sb.append(delim);//from  w  ww  . ja v  a  2  s  .  com
            }
        }
        return sb.toString();
    }
}

Related

  1. joinStrings(Iterable list)
  2. joinStrings(List aList, String aString)
  3. joinStrings(List list, String delim)
  4. joinStrings(List strings, String separator)
  5. joinStrings(List strings, String separator)
  6. joinStrings(String joiner, List objects)
  7. joinTextWithCommas(List list)
  8. joinThreads(List threads)
  9. joinTokens(final List tokens)