Java tutorial
//package com.java2s; public class Main { public static int[] stringToIntArray(String text) { String[] parts = text.split("\\s"); int[] values = new int[parts.length]; for (int i = 0; i < parts.length; i++) { values[i] = Integer.valueOf(parts[i]); } return values; } }