Here you can find the source of stringToList(String s)
public static List<String> stringToList(String s)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.List; public class Main { public static List<String> stringToList(String s) { return Arrays.asList(splitOnSpaces(s)); }/* w w w . j av a 2s . c o m*/ public static String[] splitOnSpaces(String s) { if ("".equals(s)) { return new String[0]; } return s.split("[ ]+"); } }