org.apache.http.util.TextUtils.java Source code

Java tutorial

Introduction

Here is the source code for org.apache.http.util.TextUtils.java

Source

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;
    }
}