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