Java Comma Separated List stringToList(String commaSeparatedList)

Here you can find the source of stringToList(String commaSeparatedList)

Description

string To List

License

Apache License

Declaration

public static List<String> stringToList(String commaSeparatedList) 

Method Source Code

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

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<String> stringToList(String commaSeparatedList) {
        ArrayList<String> list = new ArrayList<String>();
        String[] preprocessedList = commaSeparatedList.split(",");

        for (String string : preprocessedList) {
            list.add(string.trim());//from   ww w  .  j  av  a2  s.c  o m
        }
        return list;
    }
}

Related

  1. splitOnCommas(final String commaSeparatedList)
  2. stringListStringWithoutBracketsCommaSeparated(List list)
  3. stringsToCommaString(List strings)
  4. stringToCommaText(List strings)
  5. stringToList(final String commaSeparated)
  6. toCommaDelimited(List values)
  7. toCommaList(Collection items)
  8. toCommaSeparated(List list)
  9. toCommaSeparated(List list)