Lodash _.toLower() Method
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
// Requiring the lodash library const _ = require( "lodash" ); // Use of _.toLower() method console.log(_.toLower( 'Beginner-For-Beginner' )); console.log(_.toLower( '#--w3wiki--#' )); |
Output:
'Beginner-for-Beginner'
'#--w3wiki--#'
Example 2: In this example, we are converting the given value into all lowercase.
Javascript
// Requiring the lodash library const _ = require( "lodash" ); // Given string let str = "Hello Beginner!" ; // Use of _.toLower() method console.log(_.toLower(str)); |
Output:
'hello Beginner!'
Contact Us