Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Lodash _.startCase() Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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
Last Updated : 03 Sep, 2020
Like Article
Save Article
Similar Reads
Related Tutorials