var strVariable; for(var i=0;i<25;i++) { console.log(String.fromCharCode((65+i))); } strVariable.toUpperCase( ); //转大写 strVariable.toLowerCase( ); //转小写 //字符转ascii码:用charCodeAt(); //ascii码砖字符:用fromCharCode(); //大写字母A 到Z 的值是从65 到90; //小写a到z 是从91 到 122; //如: str="A"; code = str.charCodeAt();//65 str2 = String.fromCharCode(code);//A str3 = String.fromCharCode(0x60+26);//Z
转自:https://www.cnblogs.com/mingrn/p/8064082.html
原文地址:https://www.cnblogs.com/hycms/p/12267747.html
时间: 2024-10-09 03:35:48