Here you can find the source of toInteger(String[] source)
public static Integer[] toInteger(String[] source)
//package com.java2s; //License from project: Open Source License public class Main { public static Integer[] toInteger(String[] source) { Integer[] result = new Integer[source.length]; for (int i = 0; i < source.length; i++) { Integer v = Integer.getInteger(source[i]); if (v != null) { result[i] = v;/*from w w w . j a va2s . co m*/ } } return result; } public static Integer[] toInteger(String source) { if (!isEmpty(source)) { return toInteger(source.split(",")); } else { return null; } } public static int toInteger(String source, int value) { if (!isEmpty(source)) { try { return Integer.parseInt(source); } catch (Exception e) { } } return value; } public static boolean isEmpty(String str) { return (str == null || "".equals(str.trim())); } public static boolean equals(String str1, String str2) { if (str1 != null && str1 != null) { return str1.equals(str2); } else if (str1 == null && str2 == null) { return true; } else { return false; } } }