Android String Empty Check isEmpty(String s)

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

Description

Check if string is null or empty.

Return

true if string is null or empty

Declaration

public static boolean isEmpty(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static final String EMPTY = "";
    public static final String NULL = "null";

    /**//ww  w .  j  a va  2  s  . c  o  m
     * Check if string is null or empty.
     * @return <b>true</b> if string is null or empty
     */
    public static boolean isEmpty(String s) {
        if (null == s || s.trim().equals(EMPTY) || s.trim().equals(NULL))
            return true;
        return false;
    }
}

Related

  1. isEmptyOrNull(String str)
  2. toNullIfEmptyOrWhitespace(String string)
  3. toNullIfEmpty(String string)
  4. isNullOrEmptyOrOnlyWhitespaces(String string)
  5. nullToEmpty(String url)
  6. isEmpty(String s)
  7. isEmpty(String str)
  8. trimToEmpty(String str)
  9. isEmpty(String string)