try { Integer.parseInt(sNum); } catch(NumberFormatException nfe) { log.error("此字符串不是数字:"+sNumber); }
这大概是最简单方法了,相比用for循环对每个char进行isDigit判断代码少很多。