Java List to String toString(List list, String delimiter)

Here you can find the source of toString(List list, String delimiter)

Description

to String

License

Apache License

Declaration

public static String toString(List<String> list, String delimiter) 

Method Source Code

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

import java.util.Iterator;
import java.util.List;

public class Main {
    public static String toString(List<String> list, String delimiter) {
        String argumentString = "";
        Iterator<String> iterator2 = list.iterator();
        for (int i = 0; iterator2.hasNext(); i++) {
            String argument = iterator2.next();
            if (i > 0)
                argumentString += delimiter;
            argumentString += argument;/*from w  ww . j av a2s . c o  m*/
        }
        return argumentString;
    }
}

Related

  1. toString(List> values)
  2. toString(List listOriginal)
  3. toString(List input, String sep)
  4. toString(List list)
  5. toString(List list)
  6. toString(List list, String split)
  7. toString(List strings)
  8. toString(List strings)
  9. toString(List list)

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