Android String Empty Check isEmpty(String input)

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

Description

is Empty

Declaration

public static boolean isEmpty(String input) 

Method Source Code

//package com.java2s;

public class Main {

    public static boolean isEmpty(String input) {
        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;
            }//from  www .ja v a2s  .  c  om
        }
        return true;
    }

    public static boolean equals(String str1, String str2) {
        return str1 == str2 || str1 != null && str1.equals(str2);
    }
}

Related

  1. isBlank(String string)
  2. isBlank(String str)
  3. isBlank(String str)
  4. isNotBlank(String str)
  5. isBlank(String text)
  6. isNullOrEmpty(String str)
  7. isEmpty(final String value)
  8. isEmpty(String s)
  9. isEmpty(String value)