toUpperCase()

优质
小牛编辑
121浏览
2023-12-01

toUpperCase 方法

把字符串转换为大写。

语法:

  stringObject.toUpperCase();

返回值:

一个新的字符串,在其中 stringObject 的所有小写字符全部被转换为了大写字符。

示例:

  var Str = "hello graybobo";

  console.log( Str.toUpperCase() );

结果:

  >>>
  HELLO GRAYBOBO