Merge remote-tracking branch 'origin/master'
| | |
| | | return str; |
| | | } |
| | | |
| | | /** 校验字符串是否整数 */ |
| | | public static boolean checkStrIsInt(String str){ |
| | | if(StringUtils.isEmpty(str)){ |
| | | return false; |
| | | } |
| | | try{ |
| | | Integer.parseInt(str); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 字符串转整形 |
| | | * @param str |
| | | * @param defInt 默认整数 |
| | | * @return |
| | | */ |
| | | public static int strChangeInt(String str, Integer defInt){ |
| | | if(defInt == null){ |
| | | defInt = 0; |
| | | } |
| | | if(StringUtils.isEmpty(str)){ |
| | | return defInt; |
| | | } |
| | | try{ |
| | | return Integer.parseInt(str); |
| | | }catch (Exception e){ |
| | | return defInt; |
| | | } |
| | | } |
| | | } |