char 判断字符是否为大小写


public static void main(String[] args) {
    
    char c = 'S';
    System.out.println( c>='A' && c<='Z'?true:false);
}

如果输出为 true 则说明 c 的字符为大写;

如果输出为 false 则说明 c 的字符为小写;

猜你喜欢

转载自blog.csdn.net/dbsjack/article/details/78181108