Java Integer Convert To convertIntfwl(String[] idArray)

Here you can find the source of convertIntfwl(String[] idArray)

Description

convert idArray to [].

License

Open Source License

Parameter

Parameter Description
idArray a parameter

Declaration

public static int[] convertIntfwl(String[] idArray) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*  w  w w .j  a va 2  s . c  om*/
     * convert idArray to []. 1,2,3,4 --> [1,2,3,4] catch exception add by fwl
     * 
     * @param idArray
     * @return
     */
    public static int[] convertIntfwl(String[] idArray) {
        int[] desArray = new int[idArray.length];
        for (int i = 0; i < desArray.length; i++) {
            try {
                desArray[i] = Integer.parseInt(idArray[i]);
            } catch (NumberFormatException e) {
                desArray[i] = 0;
            }
        }
        return desArray;
    }
}

Related

  1. convertIntegerToTwoCharString(int integer)
  2. convertInteralNameToResourceName(String type1)
  3. convertInternalClassNameToQualifiedName(String className)
  4. convertInternalFormToQualifiedClassName( final String classInternalName)
  5. convertIntFromBytes(byte[] byteArray)
  6. convertIntList(Integer[] list)
  7. convertIntoRange(Integer inValue, int inSteps, int inMin, int inMax)
  8. convertIntToDayOfWeek(int day)
  9. convertIntToDouble(final int[] intValues)