- package com.kxg_05;
- public class CharacterDemo {
- public static void main(String[] args) {
- // Character类
- Character ch = 'F';
- // public static boolean isUpperCase(char ch):判断是否大写
- System.out.println(Character.isUpperCase(ch));
- // public static boolean isLowerCase(char ch):判断是否小写
- System.out.println(Character.isLowerCase(ch));
- // public static boolean isDigit(char ch):判断是否为数字
- System.out.println(Character.isDigit(ch));
- // public static char toLowerCase(char ch):转换小写
- System.out.println(Character.toLowerCase(ch));
- // public static char toUpperCase(char ch):转换大写
- System.out.println(Character.toUpperCase(Character.toLowerCase(ch)));
- }
- }
复制代码
|
|