Here you can find the source of toArray(String number)
private static int[] toArray(String number)
//package com.java2s; //License from project: Open Source License public class Main { private static int[] toArray(String number) { int[] array = new int[number.length()]; for (int i = 0; i < number.length(); i++) { array[i] = Integer.parseInt(number.substring(i, i + 1)); }// w w w. j a va 2 s . co m return array; } }