Here you can find the source of asList(String source, String separator)
public static List<String> asList(String source, String separator)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static List<String> asList(String source, String separator) { Scanner scanner = new Scanner(source); scanner.useDelimiter(separator); List<String> list = new ArrayList<String>(); while (scanner.hasNext()) { list.add(scanner.next());/*from www . java 2 s . c o m*/ } return list; } }