Easy way to see if an input is an integer?
Is there a simple way to see if an input 开发者_如何学Pythonis an integer in Java?
try {
Integer.parseInt(myString);
} catch(NumberFormatException e) {
// Not an integer
}
Documentation for parseInt()
if you're interested.
精彩评论