public static boolean isInteger(String str){ Pattern pattern = Pattern.compile("1?[\d]*$"); return pattern.matcher(str).matches(); } -\+ ↩︎