Java tutorial
package org.apache.http.util; public final class TextUtils { public static boolean isEmpty(CharSequence charSequence) { if (charSequence == null || charSequence.length() == 0) { return true; } return false; } public static boolean isBlank(CharSequence charSequence) { if (charSequence == null) { return true; } for (int i = 0; i < charSequence.length(); i++) { if (!Character.isWhitespace(charSequence.charAt(i))) { return false; } } return true; } }