var str = "Hello World!";
var res = str.toUpperCase(); //HELLO WORLD!
const toCapitalCase = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
};
let str = "Hello World!";
let res = str.toUpperCase();
console.log(res) //HELLO WORLD!
const string = "A string";
const upperCase = string.toUpperCase();
console.log(upperCase); // -> A STRING
const lowerCase = string.toLowerCase();
console.log(lowerCase); // -> a string
function changeToUpperCase(founder) {
return founder.toUpperCase();
}
// calling the function
const result = changeToUpperCase("Quincy Larson");
// printing the result to the console
console.log(result);
// Output: QUINCY LARSON
.toUpperCase()
// Like this:
alert("In upper case: " + "my string".toUpperCase()); // In upper case: MY STRING
const upperCase = (string) => {
const newText = string.toUpperCase();
return newText;
};
const str = "This is a very long string!";
// This will return => "THIS IS A VERY LONG STRING!"
console.log(str.toUpperCase());
//toUpperCase is a string method that returns the uppercased version of a specified string.
// We will use this to capitalize the first letter:
const firstLetter = "f"
const firstLetterCap = firstLetter.toUpperCase()
// F