Java Integer Create toInts(String[] values)

Here you can find the source of toInts(String[] values)

Description

to Ints

License

Open Source License

Declaration

public static int[] toInts(String[] values) 

Method Source Code

//package com.java2s;

public class Main {
    public static int[] toInts(String[] values) {

        int[] result = new int[values.length];

        for (int i = 0; i < result.length; i++) {
            result[i] = Integer.parseInt(values[i].trim());
        }//w  ww.ja v  a  2 s  .  co m

        return result;
    }

    public static String trim(String string, int maxLength) {
        if (string == null) {
            return null;
        }

        if (string.length() > maxLength) {
            return string.substring(0, maxLength);
        }

        return string;

    }
}

Related

  1. toInts(double[] arr)
  2. toInts(int val)
  3. toInts(Integer[] values)
  4. toInts(long[] array)
  5. toInts(String intArray)
  6. toIntsFromUBytes(byte[] byteArray)
  7. toIntStr(String floatStr)
  8. toIntString(Integer integer)
  9. toIntString(Object object)