| | |
| | | } |
| | | } |
| | | |
| | | public static boolean isInteger(String str) { |
| | | try { |
| | | double value = Double.parseDouble(str); |
| | | if (value == Math.ceil(value)) { |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Description: 获得字符(byte)的实际长度<br> |
| | |
| | | * @return |
| | | */ |
| | | public static boolean isEmpty(String str) { |
| | | return str == null || "".equals(str); |
| | | return str == null || "".equals(str.trim()); |
| | | } |
| | | |
| | | /** |
| | | * 校验是否为JSON |
| | | * |
| | | * @param msg |
| | | * @return |
| | | */ |
| | | public static Boolean isJsonObject(String msg) { |
| | | try { |
| | | JSONObject.parseObject(msg); |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | return false; |
| | | } |
| | | } |
| | | public static String delHtmlTag(String str){ |
| | | String newstr = ""; |
| | | newstr = str.replaceAll("<[.[^>]]*>",""); |
| | | newstr = newstr.replaceAll(" ", ""); |
| | | return newstr; |
| | | } |
| | | |
| | | } |