当先锋百科网

首页 1 2 3 4 5 6 7
   // 首字母大写
    public static String upperCase(String moduleName) {
        char[] ch = moduleName.toCharArray();
        if (ch[0] >= 'a' && ch[0] <= 'z') {
            ch[0] = (char) (ch[0] - 32);
        }
        return new String(ch);
    }

    // 首字母小写
    public static String lowerCase(String moduleName) {
        char[] ch = moduleName.toCharArray();
        if (ch[0] >= 'A' && ch[0] <= 'Z') {
            ch[0] = (char) (ch[0] + 32);
        }
        return new String(ch);
    }