Lodash _.toLower() Method
Last Updated :
03 Nov, 2023
Lodash _.toLower() method is used to convert the entire string to lowercase. This function does not affect any of the special characters, digits, and alphabets that are already in the lowercase.
Syntax:
_.toLower( [string = '']);
Parameters:
- string: This parameter holds the string to convert.
Return Value:
This method returns the lowercase string.
Example 1: In this example, we are converting the given value into all lowercase.
Javascript
const _ = require( "lodash" );
console.log(_.toLower( 'Geeks-For-Geeks' ));
console.log(_.toLower( '#--GeeksForGeeks--#' ));
|
Output:
'geeks-for-geeks'
'#--geeksforgeeks--#'
Example 2: In this example, we are converting the given value into all lowercase.
Javascript
const _ = require( "lodash" );
let str = "Hello Geeks!" ;
console.log(_.toLower(str));
|
Output:
'hello geeks!'
Share your thoughts in the comments
Please Login to comment...