判断输入的是否是数字

xiaoxiao2021-02-28  24

public boolean isNumeric(String str){ Pattern pattern = Pattern.compile("[0-9]*"); Matcher isNum = pattern.matcher(str); if( !isNum.matches() ){ return false; } return true; }
转载请注明原文地址: https://www.6miu.com/read-2630327.html

最新回复(0)