Here you can find the source of toInts(String intArray)
Parameter | Description |
---|---|
intArray | a parameter |
public static int[] toInts(String intArray)
//package com.java2s; /**/*from www. j av a 2 s .c om*/ * <p>This class contains utility tools for all common or proprietary * assembling classes.</p> * * <p>This source is free; you can redistribute it and/or modify it under * the terms of the GNU General Public License and by nameing of the originally author</p> * * @author Markus Zimmermann <a href="http://www.die-seite.ch">http://www.die-seite.ch</a> * @version 3.1 */ public class Main { /** * converts int values from string separated by * " " (space) to an Array of integer * @param intArray * @return */ public static int[] toInts(String intArray) { String[] s = intArray.split(" "); int[] ia = new int[s.length]; for (int i = 0; i < ia.length; i++) { ia[i] = Integer.parseInt(s[i]); } return ia; } }