java 判断字符串是否为数字

str.matches("\\d+")

如果值是true

Integer.parseInt(str);就可以转为int了

posted @ 2019-10-09 09:19  不打鱼光晒网  阅读(184)  评论(0)    收藏  举报