Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java split int

String str = "1 16 217 22 992";

        String[] numbersAsStrings = str.split(" ");
        int[] numbers = new int[numbersAsStrings.length];

        for (int i = 0; i < numbersAsStrings.length; i++) {
            numbers[i] = Integer.parseInt(numbersAsStrings[i]);
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #split #int
ADD COMMENT
Topic
Name
5+4 =