Java String to Int convertStringToInteger(String string)

Here you can find the source of convertStringToInteger(String string)

Description

convert String To Integer

License

Open Source License

Declaration

private static Integer convertStringToInteger(String string) 

Method Source Code

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

public class Main {
    private static Integer convertStringToInteger(String string) {
        if (string == null) {
            return null;
        }// w  w w.  j a  v a 2s  . c  om
        try {
            Integer integer = Integer.parseInt(string.trim());
            return integer;
        } catch (NumberFormatException e) {
            return null;
        }
    }
}

Related

  1. convertStringToInt(String str)
  2. convertStringToInt(String value)
  3. convertStringToInteger(String num)
  4. convertStringToInteger(String s)
  5. convertStringToInteger(String s)
  6. convertStringToInteger(String strParaConvert)
  7. convertStringToInteger(String value)
  8. convertStringToInteger(String value)
  9. convertStringToInteger(String value)