Java - Write code to check if a string is All Lower Case

Requirements

Write code to check if a string is All Lower Case

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String cs = "book2s.com";
        System.out.println(isAllLowerCase(cs));
    }/*  ww  w .  j a  v  a2s .  c  om*/

    public static boolean isAllLowerCase(String cs) {
        if (cs == null || isEmpty(cs)) {
            return false;
        }
        int sz = cs.length();
        for (int i = 0; i < sz; i++) {
            if (Character.isLowerCase(cs.charAt(i)) == false) {
                return false;
            }
        }
        return true;
    }

    public static boolean isEmpty(String chkStr) {
        if (chkStr == null) {
            return true;
        } else {
            return "".equals(chkStr.trim()) ? true : false;
        }
    }
}

Related Exercise