Android String Null Convert isEmptyOrWhitespaceOnly(String str)

Here you can find the source of isEmptyOrWhitespaceOnly(String str)

Description

is Empty Or Whitespace Only

Declaration

public static boolean isEmptyOrWhitespaceOnly(String str) 

Method Source Code

//package com.java2s;

import android.text.TextUtils;

public class Main {
    public static boolean isEmptyOrWhitespaceOnly(String str) {
        if (TextUtils.isEmpty(str)) {
            return true;
        }/* w w w. jav  a2 s.  co m*/
        for (int i = 0; i < str.length(); i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. convertToNull(String chaine)
  2. defaultIfNull(String str)
  3. defaultIfNull(String str, String defaultStr)
  4. defaultIfBlank(String str, String defaultStr)
  5. defaultIfBlank(String str)
  6. toStringWhenNull(Object src, String newValue)
  7. toStringWhenNullOrEmpty(Object src, String newValue)
  8. toStringWhenNullOrEmptyOrSpace(Object src, String newValue)