List of utility methods to do String Empty
String | emptyStringIfNull(String s) empty String If Null return (s == null || s.equals("")) ? "-" : s; |
String | emptyStringIfNull(String string) Returns an empty string if null. if (!hasLength(string)) { return ""; return string; |
String[] | emptyStrings() empty Strings return emptyStrings_;
|
Long | emptyStringToLongZero(String s) empty String To Long Zero if (s.length() == 0) { return 0L; } else { return Long.parseLong(s); |
String | emptyStringToNull(String value) empty String To Null return value.length() == 0 ? null : value;
|
String | firstNotEmpty(String... values) first Not Empty for (String value : values) { if (value != null && !value.isEmpty()) return value; return null; |
String | getFirstNotEmpty(String str, String sperator) get First Not Empty List<String> parts = Arrays.asList(str.split("/")); for (String part : parts) { if (!isEmpty(part)) { return part; return str; |
boolean | isAnyEmpty(String... sAry) is Any Empty for (String s : sAry) { if (isEmpty(s)) return true; return false; |
boolean | isEmpty(String input) is Empty return input == null || input.trim().length() == 0;
|
boolean | isEmpty(String param) is Empty return param == null || param.length() == 0 || param.trim().equals(""); |