Android Utililty Methods String Empty Check

List of utility methods to do String Empty Check

Description

The list of methods to do String Empty Check are organized into topic(s).

Method

booleanckIsEmpty(String s)
ck Is Empty
if (s == null || s.trim().equals("") || s.trim().equals("null")) {
    return true;
return false;
BooleanisEmptyOrNull(String str)
is Empty Or Null
if (str != null) {
    if (!str.equals("")) {
        return false;
return true;
StringfilterString(String string)
filter String
if (isEmptyOrNull(string)) {
    return "";
return string.trim();
booleanisBlank(String s)
is Blank
if (s == null) {
    return true;
return Pattern.matches("\\s*", s);
booleanisBlank(String str)
is Blank
if (null == str)
    return true;
if ("".equals(str.trim()))
    return true;
return false;
booleanisBlank(EditText editText)
is Blank
return editText == null || editText.getText() == null
        || editText.getText().toString() == null
        || editText.getText().toString().trim().equals("");
booleanisBlank(String string)
is Blank
return string == null || string.trim().equals("");
booleanisBlank(String str)
is Blank
return null == str || "".equals(str.toString());
booleanisBlank(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;
booleanisNotBlank(String str)
is Not Blank
return !StringUtil.isBlank(str);