Here you can find the source of toIntArray(String src)
public static int[] toIntArray(String src)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] toIntArray(String src) { if (src == null || src.length() == 0) { return null; }//from w w w . j a v a2 s . co m int length = src.length(); int[] dst = new int[length]; for (int i = 0; i < length; i++) { dst[i] = Integer.parseInt(String.valueOf(src.charAt(i))); } return dst; } }