Here you can find the source of stringToIntegerList(String input)
public static List<Integer> stringToIntegerList(String input)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> stringToIntegerList(String input) { List<Integer> ret = new ArrayList<Integer>(); String prepared = input.replaceAll(" ", ""); for (String s : prepared.split(",")) { ret.add(Integer.valueOf(s)); }//from w w w . ja v a 2 s. c om return ret; } }