Android String to Int Convert isInteger(String string)

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

Description

is Integer

Declaration

public static boolean isInteger(String string) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean isInteger(String string) {
        try {/*w  w w. j  av  a 2s  .  com*/
            Integer.parseInt(string);
        } catch (NumberFormatException e) {
            return false;
        }

        return true;

    }
}

Related

  1. parseInt(String s)
  2. isInt(final String chaineToTest)
  3. getValueOfSafely(String stringToConvert, int defaultValue)
  4. toInt(String str, int defValue)
  5. toInt(Object obj)
  6. isNullOrWhiteSpace(final String string)