Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Lodash _.startCase() Method

  • Last Updated : 03 Sep, 2020

The _.startCase() method is used to convert the string to start the case.

Syntax:

_.startCase( [string=''] )

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

  • string: This parameter holds the string to convert.

Return Value: This method returns the start of the case string.

Below example illustrate the Lodash _.startCase() method in JavaScript:

Example 1:

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
       
// Use of _.startCase() method 
console.log(_.startCase('geeks for geeks')); 
console.log(_.startCase('geeksforgeeks'));
console.log(_.startCase('@#$%geeksforgeeks@#$%'));

Output:

'Geeks For Geeks'
'Geeksforgeeks'
'Geeksforgeeks'

Example 2:  

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
       
// Use of _.startCase() method 
console.log(_.startCase(null)); 
console.log(_.startCase('123456789'));
console.log(_.startCase("gfg.Id"));

Output:

''
'123456789'
'Gfg Id'
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!