JS字母码值转换方法

字符转ascii码:用charCodeAt();
ascii码转字符:用fromCharCode();

大写字母A 到Z 的值是从65 到90

小写a到z 是从97 到 122

"a".charCodeAt(0)==97

String.fromCharCode(97)=="a"

转换成大写:toUpperCase()
转换成小写:toLowerCase()

posted @ 2020-12-17 11:46  大萨特  阅读(712)  评论(0)    收藏  举报