Java Integer Create toIntArray(String[] ss)

Here you can find the source of toIntArray(String[] ss)

Description

to Int Array

License

Open Source License

Parameter

Parameter Description
ss a parameter

Declaration

public static int[] toIntArray(String[] ss) 

Method Source Code

//package com.java2s;

public class Main {
    /**// ww w .  j a  v a 2  s.  c  o m
     * @param ss
     * @return
     */
    public static int[] toIntArray(String[] ss) {
        int[] is = new int[ss.length];
        for (int i = 0; i < ss.length; i++) {
            is[i] = toInt(ss[i]);
        }
        return is;
    }

    public static int toInt(String s) {
        try {
            return Integer.parseInt(s);
        } catch (NumberFormatException e) {
            return 0;
        }
    }
}

Related

  1. toIntArray(String str, String delimiter)
  2. toIntArray(String str, String separator)
  3. toIntArray(String value)
  4. toIntArray(String[] anArray)
  5. toIntArray(String[] array)
  6. toIntArrayUnshifted(byte... arguments)
  7. toIntBE(byte[] src, int offset)
  8. toIntBigEndian(byte[] input)
  9. toIntDecoded(String s)