Lodash _.upperCase() Method
Lodash _.upperCase() method is used to convert the entire string to space-separated words, to upper case.
Syntax:
_.upperCase( [string = '']);
Parameters:
- string: This parameter holds the string to convert.
Return Value:
This method returns the upper case string.
Example 1: In this example, we are making the first alphabet capital by the use of the lodash _.upperCase() method.
Javascript
const _ = require( "lodash" );
console.log(_.upperCase( 'Geeks-For-Geeks' ));
console.log(_.upperCase( '#--GeeksForGeeks--#' ));
|
Output:
'GEEKS FOR GEEKS'
'GEEKS FOR GEEKS'
Example 2: In this example, we are making the first alphabet capital by the use of the lodash _.upperCase() method.
Javascript
const _ = require( "lodash" );
let str = "Hello Geeks!" ;
console.log(_.upperCase(str));
|
Output:
'HELLO GEEKS'
Last Updated :
03 Nov, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...