Android String to Int Convert isInt(final String chaineToTest)

Here you can find the source of isInt(final String chaineToTest)

Description

is Int

Parameter

Parameter Description
chaineToTest a parameter

Return

check if string is int format

Declaration

public static boolean isInt(final String chaineToTest) 

Method Source Code

//package com.java2s;

public class Main {
    /**//w  ww. j a v a 2s  .com
     * @param chaineToTest
     * @return check if string is int format
     */
    public static boolean isInt(final String chaineToTest) {
        try {
            Integer.parseInt(chaineToTest);
            return true;
        } catch (final Exception e) {
            return false;
        }
    }
}

Related

  1. parseInt(String s)
  2. isInteger(String string)
  3. getValueOfSafely(String stringToConvert, int defaultValue)
  4. toInt(String str, int defValue)
  5. toInt(Object obj)