通过 toUpperCase()
把字符串转换为大写:
实例
var text1 = "Hello World!"; // 字符串 var text2 = text1.toUpperCase(); // text2 是被转换为大写的 text1
亲自试一试
通过 toLowerCase()
把字符串转换为小写:
实例
var text1 = "Hello World!"; // 字符串 var text2 = text1.toLowerCase(); // text2 是被转换为小写的 text1