Here you can find the source of convertToList(String inputString)
Parameter | Description |
---|---|
inputString | a parameter |
public static List<String> convertToList(String inputString)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /**/*from w w w .j a va2 s . com*/ * converts a given comma separated String into a list of Strings * @param inputString * @return */ public static List<String> convertToList(String inputString) { ArrayList<String> list = new ArrayList<String>(); if (inputString == null || inputString.equals("")) { return list; } String[] strings = inputString.split(","); for (String s : strings) { list.add(s); } return list; } }