List of utility methods to do String Empty Check
boolean | isBlank(String text) Whether the String is null, zero-length and does contain only whitespace if (isEmpty(text)) return true; for (int i = 0; i < text.length(); i++) { if (!Character.isWhitespace(text.charAt(i))) return false; return true; |
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; |
boolean | isNullOrEmpty(String str) is Null Or Empty return str == null || str.trim().length() == 0;
|
boolean | isEmpty(final String value) Returns true if the string is null or 0-length. return value == null || value.length() == 0;
|
Boolean | isEmpty(String s) is Empty boolean flag; if (s == null || s.length() == 0) flag = true; else flag = false; return Boolean.valueOf(flag); |
boolean | isEmpty(String value) is Empty return (value == null || value.trim().length() == 0);
|
boolean | isNotEmpty(String value) is Not Empty return (!isEmpty(value));
|
boolean | isEmptyOrNull(String string) is Empty Or Null if (string == null) { return true; if (string.trim().length() == 0) { return true; return false; |
boolean | isEmpty(String input) is Empty if (input == null || "".equals(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; |
boolean | isNotEmpty(String s) is Not Empty return (s != null && s.trim().length() > 0);
|