Java List Join join(List s, String delim)

Here you can find the source of join(List s, String delim)

Description

join

License

Apache License

Declaration

private static String join(List<String> s, String delim) 

Method Source Code

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

import java.util.*;

public class Main {
    private static String join(List<String> s, String delim) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < s.size() - 1; i++) {
            sb.append(s.get(i));//from   ww w. ja  v  a  2  s. c o  m
            sb.append(delim);
        }

        if (s.size() > 0)
            sb.append(s.get(s.size() - 1));

        return sb.toString();
    }
}

Related

  1. join(List lst, String separator)
  2. join(List members, boolean quote)
  3. join(List p_sStrList, String p_sDelimiter)
  4. join(List parts, String separator)
  5. join(List paths)
  6. join(List s, String sep)
  7. join(List strings)
  8. join(List strings)
  9. join(List strings)