is String Upper Case - Java java.lang

Java examples for java.lang:String Case

Description

is String Upper Case

Demo Code

/***********************************************
 * Copyright to Vivek Kumar Singh * * Any part of code or file can be changed, *
 * redistributed, modified with the copyright * information intact * * Author$ :
 * Vivek Singh * */*  w  w w .jav a2  s .  c o m*/
 ***********************************************/
//package com.java2s;

public class Main {
    public static boolean isUpperCase(String s) {
        int strl = s.length();
        int i = 0;
        while (i < strl) {
            char nextC = s.charAt(i);
            if (Character.isUpperCase(nextC) == false)
                return false;
            i++;
        }
        return true;
    }
}

Related Tutorials