Java Comma Separated List stringListStringWithoutBracketsCommaSeparated(List list)

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

Description

string List String Without Brackets Comma Separated

License

Open Source License

Declaration

public static String stringListStringWithoutBracketsCommaSeparated(List<String> list) 

Method Source Code


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

import java.util.List;

public class Main {
    public static String stringListStringWithoutBracketsCommaSeparated(List<String> list) {
        return stringListStringWithoutBracketsWithSpecifiedSeparator(list, ",");
    }//from  w  w  w.  ja v a 2 s .c  om

    public static String stringListStringWithoutBracketsWithSpecifiedSeparator(List<String> list,
            String separator) {

        String result = "";
        for (int i = 0; i < list.size() - 1; i++) {
            result += list.get(i) + separator;
        }

        if (list.size() > 0) {
            // get the generated word for the last target position
            result += list.get(list.size() - 1);
        }

        return result;

    }
}

Related

  1. resolveCommandParam(List params, String name, double defaultValue)
  2. splitCommandsToList(String row, String delimiter)
  3. splitListByComma(List hosts)
  4. splitListWithComma(List StringList)
  5. splitOnCommas(final String commaSeparatedList)
  6. stringsToCommaString(List strings)
  7. stringToCommaText(List strings)
  8. stringToList(final String commaSeparated)
  9. stringToList(String commaSeparatedList)