Android String Empty Check isEmpty(String string)

Here you can find the source of isEmpty(String string)


is Empty


public static boolean isEmpty(String string) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean isEmpty(String string) {
        if (string == null) {
            return true;
        }//from   w  ww  .  j ava  2s .  c o  m
        if ("".equals(string)) {
            return true;
        return false;

    public static boolean isEmpty(CharSequence text) {
        if (text != null)
            return isEmpty(text.toString());
        return true;


  1. isEmpty(String value)
  2. isNotEmpty(String value)
  3. isEmptyOrNull(String string)
  4. isEmpty(String input)
  5. isNotEmpty(String s)
  6. isEmptyString(String s)
  7. isEmptyOrNull(String str)
  8. toNullIfEmptyOrWhitespace(String string)
  9. toNullIfEmpty(String string)