Java List to String toString(List input, String sep)

Here you can find the source of toString(List input, String sep)

Description

to String

License

Open Source License

Declaration

public static String toString(List<String> input, String sep) 

Method Source Code


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

import java.util.List;

public class Main {
    public static String toString(List<String> input, String sep) {
        if (input.isEmpty())
            return "";
        String result = input.get(0);
        for (int i = 1; i < input.size(); i++) {
            result += sep + input.get(i);
        }/*  w ww  .  ja  v a2 s  . co m*/
        return result;
    }
}

Related

  1. toString(List c)
  2. toString(List list)
  3. toString(List> classes)
  4. toString(List> values)
  5. toString(List listOriginal)
  6. toString(List list)
  7. toString(List list)
  8. toString(List list, String delimiter)
  9. toString(List list, String split)

  10. HOME | Copyright © www.java2s.com 2016