Here you can find the source of splitIntegerPerDigit(int i)
public static List<Integer> splitIntegerPerDigit(int i)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> splitIntegerPerDigit(int i) { // Splits an integer into corresponding array of numbers. // http://stackoverflow.com/questions/5196186/split-int-value-into-seperate-digits List<Integer> digits = new ArrayList<Integer>(); while (i > 0) { digits.add(i % 10);/*from w w w . j a v a2 s .co m*/ i /= 10; } return digits; } }