Lodash _.startCase() Method
Last Updated :
20 Oct, 2023
Lodash _.startCase() method is used to convert the string to start case.
Syntax:
_.startCase( [string=''] );
Parameters:
- string: This parameter holds the string to convert.
Return Value:
This method returns the start of the case string.
Example 1: In this example, we have used the _.startCase() method for converting the given string into the start case string.
Javascript
const _ = require( "lodash" );
console.log(_.startCase( 'geeks for geeks' ));
console.log(_.startCase( 'geeksforgeeks' ));
console.log(_.startCase( '@#$%geeksforgeeks@#$%' ));
|
Output:
'Geeks For Geeks'
'Geeksforgeeks'
'Geeksforgeeks'
Example 2: In this example, we have used the _.startCase() method for converting the given string into the start case string.
Javascript
const _ = require( "lodash" );
console.log(_.startCase( null ));
console.log(_.startCase( '123456789' ));
console.log(_.startCase( "gfg.Id" ));
|
Output:
''
'123456789'
'Gfg Id'
Share your thoughts in the comments
Please Login to comment...