Here you can find the source of stringToList(String toList, String delimiter)
Parameter | Description |
---|---|
toList | string to convert to list |
delimiter | a parameter |
static public ArrayList<String> stringToList(String toList, String delimiter)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//w ww. j a v a 2s. c om * Convert string to list * * @param toList string to convert to list * @param delimiter * @return Output List */ static public ArrayList<String> stringToList(String toList, String delimiter) { ArrayList<String> list = new ArrayList<String>(); if (toList != null && !toList.isEmpty()) { String[] names = toList.split(delimiter); for (int i = 0; i < names.length; i++) { list.add(names[i]); } } return list; } }