Skip to content
Related Articles

Related Articles

Lodash _.lowerCase() Method

View Discussion
Improve Article
Save Article
  • Last Updated : 07 Sep, 2020

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.

The _.lowerCase() method is used to convert the given string, as space separated words, to lower case.

Syntax:

_.lowerCase([string=''])

Parameters: This method accepts single parameter as mentioned above and described below:

  • string: This parameter holds the string that need to convert into lower case.

Return Value: This method returns the lower cased string.

Example 1:

Javascript




const _ = require('lodash'); 
  
var str1 = _.lowerCase("GEEKS FOR GEEKS");
console.log(str1);
  
var str2 = _.lowerCase("GFG--Geeks");
console.log(str2);


Output:

"geeks for geeks"
"gfg geeks"

Example 2:

Javascript




const _ = require('lodash'); 
  
var str1 = _.lowerCase("GEEKS__FOR__GEEKS");
console.log(str1);
  
var str2 = _.kebabCase("G4G--geeks--GEEKS");
console.log(str2);
  
var str3 = _.kebabCase("GEEKS-----FOR_____Geeks");
console.log(str3);


Output:

"geeks for geeks"
"g-4-g-geeks-geeks"
"geeks-for-geeks"
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!