Here you can find the source of splitToInteger(String str)
private static List<Integer> splitToInteger(String str)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { private static List<Integer> splitToInteger(String str) { String[] chars = str.split(""); List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < chars.length; i++) { try { list.add(new Integer(chars[i])); } catch (NumberFormatException nfe) { // do nothing }//from ww w .j ava 2s. co m } return list; } }