該方法返回調用字符串值轉換為大寫。
語法
string.toUpperCase( )
下面是參數的詳細信息:
返回值:
例子:
<html> <head> <title>JavaScript String toUpperCase() Method</title> </head> <body> <script type="text/javascript"> var str = "Apples are round, and Apples are Juicy."; document.write(str.toUpperCase( )); </script> </body> </html>
這將產生以下結果:
APPLES ARE ROUND, AND APPLES ARE JUICY.