| | |
| | | } |
| | | |
| | | /** |
| | | * 字符串,是否为空 |
| | | * 字符串,是否为null或"" |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isNull(String str) { |
| | | return null == str || str.length() == 0; |
| | | } |
| | | |
| | | /** |
| | | * 字符串,是否为空null和空格 |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isEmpty(String str) { |
| | | return null == str || str.length() == 0; |
| | | return str == null || "".equals(str.trim()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public static String capitalize(String str) { |
| | | String f = str.charAt(0) + ""; |
| | | |
| | | return f.toUpperCase() + str.substring(1); |
| | | return String.valueOf(str.charAt(0)).toUpperCase() + str.substring(1); |
| | | } |
| | | } |