List of utility methods to do String Empty Check
boolean | ckIsEmpty(String s) ck Is Empty if (s == null || s.trim().equals("") || s.trim().equals("null")) { return true; return false; |
Boolean | isEmptyOrNull(String str) is Empty Or Null if (str != null) { if (!str.equals("")) { return false; return true; |
String | filterString(String string) filter String if (isEmptyOrNull(string)) { return ""; return string.trim(); |
boolean | isBlank(String s) is Blank if (s == null) { return true; return Pattern.matches("\\s*", s); |
boolean | isBlank(String str) is Blank if (null == str) return true; if ("".equals(str.trim())) return true; return false; |
boolean | isBlank(EditText editText) is Blank return editText == null || editText.getText() == null || editText.getText().toString() == null || editText.getText().toString().trim().equals(""); |
boolean | isBlank(String string) is Blank return string == null || string.trim().equals(""); |
boolean | isBlank(String str) is Blank return null == str || "".equals(str.toString()); |
boolean | isBlank(String str) is Blank int strLen; if (str == null || (strLen = str.length()) == 0) { return true; for (int i = 0; i < strLen; i++) { if ((Character.isWhitespace(str.charAt(i)) == false)) { return false; return true; |
boolean | isNotBlank(String str) is Not Blank return !StringUtil.isBlank(str);
|