how to check a string is Degit code example
Example: java check if string is number
try {
int n = Integer.parseInt(str);
} catch (NumberFormatException e) {
// str is not a number
}
try {
int n = Integer.parseInt(str);
} catch (NumberFormatException e) {
// str is not a number
}