Java toUpperCase() 方法
toUpperCase() 方法用於將小寫字符轉換為大寫。
語法
char toUpperCase(char ch)
參數
ch --要轉換的字符。
返回值
返迴轉換後字符的大寫形式,如果有的話;否則返回字符本身。
實例
public class Test { public static void main(String args[]) { System.out.println(Character.toUpperCase('a')); System.out.println(Character.toUpperCase('A')); } }
以上程序執行結果為:
A A