Java List Combine combine(List strlist, String delimiter)

Here you can find the source of combine(List strlist, String delimiter)

Description

combine

License

Open Source License

Declaration

public static String combine(List<String> strlist, String delimiter) 

Method Source Code


//package com.java2s;

import java.util.List;

public class Main {
    /** @METHOD */
    public static String combine(List<String> strlist, String delimiter) {
        StringBuilder buf = new StringBuilder();
        if (strlist.isEmpty() == false) {
            for (int i = 0; i < strlist.size(); i++) {
                String elem = strlist.get(i);
                buf.append(elem);//w  ww  .  j  a va2s. c  o m
                if (i != strlist.size() - 1)
                    buf.append(delimiter);
            }
        }
        return buf.toString();
    }
}

Related

  1. combine(final List list, final List list2)
  2. combine(int sign, List exponentBits, List mantissaBits)
  3. combine(List r, char sep)
  4. combine(List> lists)
  5. combine(List commands, int startAt, int endAt)
  6. combine(List tokens, String separator)
  7. combine(List a, List b)
  8. combine(List dest, Collection... src)
  9. combine(List list, int maxK)