Hi Friends đź‘‹,
Welcome to Infinitbility ❤️!
Today, I’m going to show you how to convert a string to uppercase in typescript, here we will use the javascript toUpperCase()
method to convert it an uppercase.
So first, we will create some examples variables, then we use the toUpperCase()
method on those variables, and then we will check our console it’s working or not.
Let’s start codeing…
1let firstStr: string = 'Hello World';2let secondStr: string = 'Infinitbility';3let thirdStr: string = 'IfergUokgIgokr04';45// lets convert it6firstStr = firstStr.toUpperCase();7secondStr = secondStr.toUpperCase();8thirdStr = thirdStr.toUpperCase();910console.log(firstStr, secondStr, thirdStr);
Ok when we run the above program, we get all text in uppercase, check the following output image.
Output

All the best 👍.
Follow me on Twitter
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.