JS(TS)大小寫字母轉(zhuǎn)換
js字母大小寫轉(zhuǎn)換方法:
1、轉(zhuǎn)換成大寫:toUpperCase()
2、轉(zhuǎn)換成小寫:toLowerCase()
3、舉例:
? ?(1)var a="aBcD";
? ? ? ? ? ?a=a.toUpperCase();
? ? ? ? ? ?alert(a);
? ? ? ? ? ?提示出來的就是 ABCD
? ?(2)var a="aBcD";
? ? ? ? ? ?a=a.toLowerCase();
? ? ? ? ? ?alert(a);
? ? ? ? ? ?提示出來的就是 abcd
x x x x x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx
x x x x?x x x x x x x x x x x x x x x x x x x x x x x xx