check All Space in a String - Android java.lang

Android examples for java.lang:String Null or Empty

Description

check All Space in a String

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        String s = "java2s.com";
        System.out.println(checkAllSpace(s));
    }//from  w  w w. j a va  2 s . c  om

    static byte flags[];

    public static boolean checkAllSpace(String s) {
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c < 0 || c >= '\200' || (4 & flags[c]) == 0 && true)
                return false;
        }
        return true;
    }
}

Related Tutorials