String 对象-->toUpperCase() 方法

1.定义和用法

  将字符串中所有的小写字符转换成大写字符,大写字符保持不变

  返回转换后的结果字符串

  语法:

    string.toUpperCase()

  注意:不会改变字符串本身,仅以返回值的形式返回结果

  举例:

var str = 'Apple'
console.log(str.toUpperCase())
console.log(str)

  输出:

猜你喜欢

转载自www.cnblogs.com/abner-pan/p/12700926.html
今日推荐