How to Convert String to Lowercase using Node Js?


Share:
 | Published By: Admin | Published On: Jan 31, 2022 | Category: Node JS

Hello Friends,

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

Here i will give you many example how to convert string to lowercase 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 convertLower = "MYWEBTUTS TUTORIAL".toLowerCase();

console.log(convertLower)

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 WEBSITE.";
var strResult = str.toLowerCase();

console.log(strResult);

now you can simply run by following command:

node server.js
Output :
my webtuts website.

It will help you...

Share: