How to Convert String to Uppercase using Node Js?

Feb 01, 2022 . Admin

Hello Friends,

Now let's see example of how to convert string to uppercase. We will check how to convert string to uppercase. This is a short guide on convert string to uppercase in node js. Let's get started with how to convert string to uppercase in node js.

Here i will give you many example how to convert string to uppercase using node js.

Example 1 :

Step 1 : Create Node App

Run following command to create node app.

mkdir my-app
cd my-app
 
npm init
Step 2 : Create server.js file

server.js

var convertUpper = "mywebtuts tutorial".toUpperCase();

console.log(convertUpper)

now you can simply run by following command:

node server.js
Output :
MYWEBTUTS TUTORIAL

Example 2 :

Step 1 : Create Node App

Run following command to create node app.

mkdir my-app
cd my-app
 
npm init
Step 2 : Create server.js file

server.js

var str = "my webtuts tutorial.";
var strResult = str.toUpperCase();

console.log(strResult);

now you can simply run by following command:

node server.js
Output :
MY WEBTUTS TUTORIAL.

It will help you...

#Node JS