Here you can find the source of toIntList(String arr, String separator)
public static List<Integer> toIntList(String arr, String separator)
//package com.java2s; //License from project: LGPL import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> toIntList(String arr, String separator) { String[] array = arr.split(separator); List<Integer> r = new ArrayList<Integer>(array.length + 1); for (int i = 0; i < array.length; i++) { r.add(Integer.parseInt(array[i])); }// w w w. ja va 2 s . c om return r; } }