Navigate back to the homepage

How to convert a string to uppercase in typescript?

Infinitbility
TypeScript
April 17th, 2022 · 1 min read
keep affilitate

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';
4
5// lets convert it
6firstStr = firstStr.toUpperCase();
7secondStr = secondStr.toUpperCase();
8thirdStr = thirdStr.toUpperCase();
9
10console.log(firstStr, secondStr, thirdStr);

Ok when we run the above program, we get all text in uppercase, check the following output image.

Output

TypeScript, convert a string case to uppercase example
TypeScript, convert a string case to uppercase example

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.

melio affilitate

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide

Tutorials

Categories

More articles from Infinitbility

How to convert a string to lowercase in typescript?

TypeScript, convert a string case to lowercase example.

April 16th, 2022 · 1 min read

How to convert any to string in typescript?

TypeScript, convert any to string example.

April 14th, 2022 · 1 min read
© 2020–2022 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]