12345678910111213141516171819 |
- var a = "This is my name";
- // toUpperCase() 将字符串中所有的字母转为大写
- var b = a.toUpperCase();
- console.log(b,'toUpperCase')
- // toLowerCase() 将字符串中所有字母转为小写
- var c = b.toLowerCase();
- console.log(c,'toLowerCase')
- // concat 连接字符串
- var d = c.concat("你好",a,b);
- console.log(d,'concat');
- // trim 消除字符串中前后的空格
- var ff = ' hello,world wo ';
- var ee = ff.trim();
- console.log(ee,'trim');
|