首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

判断输入的字符串是不是为数字

2012-08-08 
判断输入的字符串是否为数字/*** 判断字符串是否是数字* */public boolean isNumber(String userInput){Pa

判断输入的字符串是否为数字

    /**     * 判断字符串是否是数字     * */    public boolean isNumber(String userInput)    {        Pattern pattern = Pattern.compile("[0-9]*");        return pattern.matcher(userInput).matches();    }
?

热点排行