is Not Blank Ascii - Java java.lang

Java examples for java.lang:char

Description

is Not Blank Ascii

Demo Code

//package com.java2s;

public class Main {

    final static public boolean isNotBlankAscii(final CharSequence cs) {
        return !isBlankAscii(cs);
    }/* www . j a  v a 2s  .  c o m*/

    final static public boolean isBlankAscii(final CharSequence cs) {
        if (cs == null) {
            return false;
        }

        int len = cs.length();
        if (len == 0) {
            return false;
        }

        for (int i = 0; i < len; ++i) {
            char c = cs.charAt(i);
            if (!Character.isWhitespace(c) && c != '?') {
                return false;
            }
        }
        return true;
    }
}

Related Tutorials