Here you can find the source of toIntArray(final String[] arrayOfIntStrings)
Parameter | Description |
---|---|
arrayOfIntStrings | a parameter |
public static int[] toIntArray(final String[] arrayOfIntStrings)
//package com.java2s; public class Main { /**//from w w w. ja v a2s . c o m * Takes an array of Strings and will convert it to an array of ints * The Strings MUST be string representations of numbers, otherwise the * behavior will be undefined * @param arrayOfIntStrings * @return an array of ints */ public static int[] toIntArray(final String[] arrayOfIntStrings) { int[] result = new int[arrayOfIntStrings.length]; for (int i = 0; i < arrayOfIntStrings.length; i++) { result[i] = Integer.valueOf(arrayOfIntStrings[i]).intValue(); } return result; } }