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.xuhuhu.com"); System.out.print("返回值 :" ); System.out.println( Str.toUpperCase() ); } }
以上程式執行結果為:
返回值 :WWW.xuhuhu.com