Here you can find the source of isBlank(String text)
public static boolean isBlank(String text)
//package com.java2s; import android.text.TextUtils; public class Main { /**/*from w ww . j ava2 s . c o m*/ * Whether the String is null, zero-length and does contain only whitespace */ public static boolean isBlank(String text) { if (isEmpty(text)) return true; for (int i = 0; i < text.length(); i++) { if (!Character.isWhitespace(text.charAt(i))) return false; } return true; } /** * Whether the given string is null or zero-length */ public static boolean isEmpty(String text) { return TextUtils.isEmpty(text); } }