开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜