Here you can find the source of stringToList(String content, String splitter)
Parameter | Description |
---|---|
content | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static List<String> stringToList(String content, String splitter)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { /**/*from w w w . j a v a 2 s .c o m*/ * split the string to tokens by splitter * @param content * @return * @throws IOException */ public static List<String> stringToList(String content, String splitter) { List<String> list = new ArrayList<String>(); String[] segs = content.split(splitter); for (String seg : segs) { list.add(seg.trim()); } return list; } }