Java toUpperCase() 方法
toUpperCase() 方法將字符串小寫字符轉換為大寫。
語法
public String toUpperCase() 或 public String toUpperCase(Locale locale)
參數
無
返回值
字符轉換為大寫後的字符串。
實例
public class Test { public static void main(String args[]) { String Str = new String("www.w3big.com"); System.out.print("返回值 :" ); System.out.println( Str.toUpperCase() ); } }
以上程序執行結果為:
返回值 :WWW.w3big.com