string uppercase
let txt = "Hello World!";
txt = txt.
toUpperCase()
;
string uppercase
let txt = "Hello World!";
txt = txt.
toUpperCase()
;
best method to convert string to upper case manually
function myToUpperCase(str) {
var newStr = '';
for (var i=0;i<str.length;i++) {
var thisCharCode = str[i].charCodeAt(0);
if ((thisCharCode>=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Ê
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us