Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
yaojianfeng 2019-08-28 11:10:20 +08:00
commit 060ba385e0
1 changed files with 3 additions and 18 deletions

View File

@ -157,8 +157,9 @@ public class V {
* @param str * @param str
* @return true Or false * @return true Or false
*/ */
public static boolean isNumeric(String str){ public static boolean isNumber(String str){
return S.isNumeric(str); String regex = "^(-?[1-9]\\d*\\.?\\d*)|(-?0\\.\\d*[1-9])|(-?[0])|(-?[0]\\.\\d*)$";
return str.matches(regex);
} }
/** /**
@ -189,22 +190,6 @@ public class V {
return valid; return valid;
} }
/**
* 判断是否为整型数字
* @param str
* @return
*/
public static boolean isNumber(String str) {
try{
S.isNumeric(str);
Integer.parseInt(str);
return true;
}
catch(Exception ex){
return false;
}
}
/** /**
* 是否boolean值范围 * 是否boolean值范围
*/ */