List of utility methods to do String Empty Check
String | trimToEmpty(String str) trim To Empty return isBlank(str) ? EMPTY : trim(str);
|
boolean | isEmpty(String string) is Empty if (string == null || string.trim().equals("")) { return true; } else { return false; |
boolean | isEmptyString(String str) is Empty String return str == null || str.trim().equals(""); |
boolean | isEmptyString(String str) is Empty String if (str == null || str.equals("")) { return true; return false; |
boolean | isNullOrEmpty(CharSequence any) CHeck to see if any is either null or empty
return (any == null || any.length() == 0);
|
boolean | isNullOrEmpty(String s) is Null Or Empty return s == null || s.length() == 0;
|
boolean | emptyOrNull(String str) empty Or Null return str == null || str.length() == 0;
|
boolean | emptyOrNull(String... arrStr) empty Or Null for (String str : arrStr) { if (emptyOrNull(str)) { return true; return false; |
boolean | isBlank(String str) is Blank return str == null || str.trim().length() == 0;
|
boolean | isEmpty(String input) is Empty if (input == null || "".equals(input)) return true; for (int i = 0; i < input.length(); i++) { char c = input.charAt(i); if (c != ' ' && c != '\t' && c != '\r' && c != '\n') { return false; return true; |