string Array To Int Array - Android java.lang

Android examples for java.lang:Array Element

Description

string Array To Int Array

Demo Code

/*// w w  w. j  a  va 2s. c  om
 * Copyright (c) 2014 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com>
 * All Rights Reserved.
 */
//package com.java2s;

public class Main {
    public static int[] stringArrayToIntArray(String[] stringArray) {
        int[] intArray = new int[stringArray.length];
        for (int i = 0; i < stringArray.length; ++i) {
            intArray[i] = Integer.parseInt(stringArray[i]);
        }
        return intArray;
    }
}

Related Tutorials