Android List to String Convert listToString(List list)

Here you can find the source of listToString(List list)

Description

list To String

Parameter

Parameter Description

Return

String

Declaration

public static String listToString(List<String> list) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {

    public static String listToString(List<String> list) {
        StringBuilder sb = new StringBuilder();
        if (list != null && list.size() > 0) {
            for (int i = 0; i < list.size(); i++) {
                if (i < list.size() - 1) {
                    sb.append(list.get(i) + ",");
                } else {
                    sb.append(list.get(i));
                }/*from  w w w.j av  a2 s.c o m*/
            }
        }
        return sb.toString();
    }
}

Related

  1. listLongToString(List inputList)
  2. listStrToString(List inputList)
  3. convertStringArrayToString( List stringList, String seperator)
  4. listToString(List list, String delimiter)
  5. getCommaDelimitedString(List input)