好代码收藏

将首字母变为大写或小写:

        char[] temp = oldStr.toCharArray();
        temp[0] -= 32;//转为大写
        // temp[0] += 32;//转为小写
        String newStr = String.valueOf(temp);

 

posted @ 2015-07-23 11:13  咸蛋oye  阅读(177)  评论(0编辑  收藏  举报