Share via


toUpperCase 方法

更新:2007 年 11 月

傳回所有字母字元都轉換成大寫的字串。

 function toUpperCase() : String

備註

toUpperCase 方法對於非字母字元不會產生任何影響。

範例

以下範例說明使用 toUpperCase 方法的效果:

var strVariable = "This is a STRING object";
strVariable = strVariable.toUpperCase();

在最後一個陳述式之後,strVariable 的值為:

THIS IS A STRING OBJECT

需求

1 版

String 物件

請參閱

參考

toLowerCase 方法