Java Integer Create toInt4Trim(String value, int _default)

Here you can find the source of toInt4Trim(String value, int _default)

Description

to Int Trim

License

Apache License

Declaration

public static int toInt4Trim(String value, int _default) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int toInt4Trim(String value, int _default) {
        if (value == null || value.trim().length() == 0)
            return _default;
        try {/* www . ja va 2  s. c o  m*/
            return Integer.valueOf(value);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return _default;
    }
}

Related

  1. toInt(T[] v)
  2. toInt24(final int value)
  3. toInt32(int[] data, int startIndex)
  4. toInt32(long x)
  5. toInt32(Object prmIntObject)
  6. toIntA(byte[] data)
  7. toIntArr(String s, String split)
  8. toIntArray(boolean[] array)
  9. toIntArray(boolean[] selectedValues)