📅  最后修改于: 2022-03-11 14:55:43.182000             🧑  作者: Mango
function myToUpperCase(str) {
var newStr = '';
for (var i=0;i=97 && thisCharCode<=122)||(thisCharCode>=224 && thisCharCode<=255)) {
newStr += String.fromCharCode(thisCharCode - 32);
} else {
newStr += str[i];
}
}
return newStr;
}
console.log(myToUpperCase('helLo woRld!')); // => HELLO WORLD!
console.log(myToUpperCase('üñïçødê')); // => ÜÑÏÇØDÊ