Java Regular Expression match upper case characters

Description

Java Regular Expression match upper case characters


//package com.demo2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        String string = "";
        System.out.println(allCharactersUpperCase(string));
    }//w  w  w . j  a  v  a  2  s  .com

    public static boolean allCharactersUpperCase(String string) {
        return string.matches("^[A-Z]*$");
    }
}



PreviousNext

Related