Here you can find the source of toIntArr(String s, String split)
public static int[] toIntArr(String s, String split)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] toIntArr(String s, String split) { String[] intStr = s.split(split); int[] res = new int[intStr.length]; for (int i = 0; i < intStr.length; ++i) { res[i] = toInt(intStr[i]);//from w w w . j a v a2 s .c o m } return res; } public static int toInt(String str) { return checkStr(str) ? Integer.parseInt(str) : 0; } private static boolean checkStr(String str) { boolean bool = true; if (str == null || "".equals(str.trim())) bool = false; return bool; } }