11 lines
183 B
Java
11 lines
183 B
Java
|
|
public boolean isNumeric(String input) {
|
||
|
|
try {
|
||
|
|
Integer.parseInt(input);
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
catch (NumberFormatException e) {
|
||
|
|
// s is not numeric
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|