Java tutorial
//package com.java2s; public class Main { public static int[] tointArray(String str, String seperator) { str = str.trim(); if (str == null || str.isEmpty()) { return null; } String[] arr = str.split(seperator); int[] result = new int[arr.length]; for (int i = 0; i < arr.length; i++) { result[i] = Integer.parseInt(arr[i]); } return result; } }