Here you can find the source of isEmptyOrWhitespaceOnly(String str)
public static boolean isEmptyOrWhitespaceOnly(String str)
//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; } }